I have list of items with check boxes using this code:
ProcessList = (ListView) findViewById(R.id.list);
ProcessList.setAdapter(new ArrayAdapter<String>(this,android.R.layout.simple_list_item_multiple_choice,nameList ));
ProcessList.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);
ProcessList.setTextFilterEnabled(true);
I am getting items checked list from:
ProcessList.setOnItemClickListener(new OnItemClickListener()
{
@Override
public void onItemClick(AdapterView<?> a, View v, int position, long id)
{
selectApp = (String) ProcessList.getItemAtPosition(position);
I am storing all checked list in array and now I want that the previously ‘checked’ items automatically ‘checks’ on restart of my app. Is there any way to do it ? (by extending my above code)
I don’t know if there is an automatic way.
Overload the ArrayAdapter class and override the function
in a way which returns checked or not based on you previous array.