Issue
I am trying to update color of listview from async task postexecute method.
I am doing ((View) lstChoices.getAdapter().getView(0,null, lstChoices)).setBackgroundColor(Color.RED);
But this is not doing anything, but I tried the same in getView method of my custom adapter then it worked, row.setBackgroundColor(Color.RED);
Any ideas what I am doing wrong?
Thanks
Solution
You should not change this that way. All what is related to the row should be handled in adapter. It means that if you changed anything that could influence background color, then all you should do is notifyDatsetChanged()
which would trigger list redraw. And b/g color should be then changed by adapter.
Answered By - Marcin Orlowski
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.