I try to cross a text of a ListView item. To do this, I use the code from http://www.jsharkey.org/blog/2008/09/15 ... id-09-sdk/
My problem is when I cross the first item of my list, it will cross the first "hidden" (the first element that we can't see without sliding the list) item of my list too. And same if I cross the second item.
Here is the code of my onListItemClick listener :
Using java Syntax Highlighting
- @Override
- protected void onListItemClick(ListView l, View v, int position, long id) {
- super.onListItemClick(l, v, position, id);
- TextView nameTextView = (TextView)v.findViewById(R.id.NameIngredientItemTextView);
- if(nameTextView.getPaintFlags()==257){
- nameTextView.setPaintFlags(nameTextView.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG);
- }
- else{
- nameTextView.setPaintFlags(nameTextView.getPaintFlags() & ~Paint.STRIKE_THRU_TEXT_FLAG);
- }
- }
Parsed in 0.032 seconds, using GeSHi 1.0.8.4
Sorry for my english, it's not my native language


