> I want to change the selected item checkbox color of listview so that when user selects the item its color gets changed this is my code :
final ListView listView = (ListView)findViewById(R.id.lvcancelorder);
ArrayAdapter<String> adapter =
new ArrayAdapter<String(this,android.R.layout.simple_list_item_single_choice, countries);
listView.setAdapter(adapter);
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
public void onItemClick(AdapterView<?> parent, View view, int position, long id)
{
selectedFromList = (listView.getItemAtPosition(position)).toString();
}});
How can i do this? Please suggest something. I know to do this in the form of a list of custom adapters, but I have no idea to do this.
source
share