I have a misunderstanding of how to dissect this error message. I know there are simpler and more elegant ways of doing this but I just wanted to do it this way to aid understanding. We are making an app where the seekbar is used to complete a times table. Sorry to dump a bunch of code but I just cant understand what it is trying to tell me.
We already made an audio player seekbar and an arraylist for family members names. I am trying to use that limited experience to create this app. Why is this not working?
The simpler the explanation the better. At this stage it is impossible to be patronising.
Ive read similar questions but its not particular to this problem. For example cannot resolve constructor 'arrayadapter(android.widget.adapterview.onitemselectedlistener, int, java.util.arraylist)'
Here is my code:
//Define Listview and Seekbar in code
final ListView listView = (ListView) findViewById(R.id.myListView);
SeekBar seekBar = (SeekBar) findViewById(R.id.mySeekBar);
//Set max and min Seekbar and get int
seekBar.setMax(20);
seekBar.setMin(1);
seekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
@Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
//Create Arraylist
ArrayList<Integer> arrayList = new ArrayList<>();
for (int i = 1; i < 15; i++){
arrayList.add(i * progress);
//create adapter and set listview
ArrayAdapter arrayAdapter = new ArrayAdapter<Integer>(this, android.R.layout.simple_list_item_1, arrayList);
listView.setAdapter(arrayAdapter);
}