> I want to change the selected item's 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);
//this is my listview
ArrayAdapter<String> adapter =
new ArrayAdapter<String(this,android.R.layout.simple_list_item_single_choice, countries); //this is the adapter
listView.setAdapter(adapter);
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
public void onItemClick(AdapterView<?> parent, View view, int position, long id) //this is the item click event
{
selectedFromList = (listView.getItemAtPosition(position)).toString();
}}); //this is the selected item from the listview
我该怎么做?请提供一些建议。 我知道可以使用列表视图自定义适配器来实现这个功能,但是不知道如何操作。