Question

I'm developing simple shopping list application. As I need code to make strike-through when item is clicked for the first time and later clear the strike-through when the item in the listview is clicked once again..

I'm able to find the code showing how to create strikethrough or clear strikethrough when onItemClickListener is performed individually.

I want the code for onItemClickListener - first when item is clicked, the item need to get strikeoff later when the strike-off item is clicked again the strikethrough needs to be cleared. Hope you got my problem?

Was it helpful?

Solution

How are you storing the list items? If you are storing it in the database, you can have an additional field may be boolean to indicate the strike through and update it when clicked (in onItemClickListener) and use it to strike off and clear.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top