I want to set the background color for a specific item in a list.
My listview is generated by an ArrayAdapter using an ArrayList.
I have a specific item in the list that I plan to change the background color.
I know the position of the position in the list.
This is my code to create a list.
respondMessageListView = (ListView) findViewById(R.id.respondMessageListView);
respondMessageListView.setAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, autoRespondMessages.getMessages()));
Thank!
[edit]
According to this post , the use of setSelection is not valid if used in onCreate (), the work around is βremove the method onAttachedToWindowin PullToRefreshListViewβ. I do not quite understand the solution. May I ask how can I do this? I am a subclass Activity, so I can no longer subclass any other class.
ssgao source
share