This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
The moose likes Android and the fly likes problem using Paint.STRIKE_THRU_TEXT_FLAG Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Mobile » Android
Bookmark "problem using Paint.STRIKE_THRU_TEXT_FLAG" Watch "problem using Paint.STRIKE_THRU_TEXT_FLAG" New topic
Author

problem using Paint.STRIKE_THRU_TEXT_FLAG

Dov Ezra
Greenhorn

Joined: Nov 23, 2010
Posts: 21
Hello everyone,

I want to code an app that display a set of Items in a list view.
if an item is broken, I want its name to have a strike-thrue line and a red background. for non broken
items, their name will have a blue background and no strike lines.

I tried to use the fallowing code in my ListAdapter.getView() to set the strike line and the background color. the result is that some items have a red background and a line, some with blue bg and line, and some have only blue background.

I don't understand how items can have both strike line and blue background. this method is the only place in my app that set strike line
Here is my code:

Johan Pelgrim
Ranch Hand

Joined: Jul 07, 2003
Posts: 105

Hi Dov,

Only thing I can think of -- from the behavior that you are describing -- is that you don't re-initialize the txt_caption object in every cycle, but I can't deduce that from your code snippet. Could you maybe create a small project which isolates your problem and make that available somewhere?

Cheers,

Johan


Johan Pelgrim, The Netherlands
SCJP 1.4, SCWCD 1.4, SCBCD 5.0
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: problem using Paint.STRIKE_THRU_TEXT_FLAG
 
jQuery in Action, 3rd edition