How to keep the colors of items that had the colors changed from listview on Android?

Asked

Viewed 45 times

0

I have a listview, and when I click on a list item it changes color, I needed to keep this color even after the list Activity was called again. Is it possible to do this without having to engrave the color on the bench? Thanks in advance.

  • take a look if you can help with anything: http://stackoverflow.com/questions/2907335/android-disabling-highlight-on-listview-click

  • that’s another thing, I just needed to save the colors of the items, for example on a list of 20 countries, if I click on the 2nd country, his item will turn green, the others will remain white, I needed to keep that green that green even after the list Activity was called again.

1 answer

0

Extend the Application class of android,and have an Arraylist Static inside your application to save these colors, save color and position of the item in the list of Arraylist.

Detail this information will only be saved until the application is closed. If close and open again will come with the standard information, to be able to persist these data permanently, only with database.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.