0

I have a list which has news titles as its listview items. when a user clicks an item a new activity opens displaying the content of the clicked news. The news content displayed is in a viewpager so user can swipe left-right for next-prev news content.

What i want to achieve is whichever item is clicked in the List of news titles that item text color changes (say grey color). So now when the user clicks an item in the list the news content activity will open and if user goes back he should now see the list with that item's text color changed so he knows which item he clicked.

Also if the user uses the viewpager functionality to swipe to the next-prev news, for those news titles also the text color in list should be changed when user goes back to the list.

i cant use xml selectors for pressed and focused state in my case.

My code is a very long/complicated code thats why i m not pasting it here. i just want to know how to achieve this effect. i've tried searching for this but all i can find is to change text color using xml selectors for pressed/focused state. I dont need the code also, i just want someone to tell me what to do or give me some direction. Any help would be appreciated and sorry for the long explanation.

Cœur
  • 37,241
  • 25
  • 195
  • 267
Abhinav Raja
  • 349
  • 1
  • 5
  • 25

0 Answers0