Meaningless Drivel is fun!
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 OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Mobile » Android
Bookmark "problem using Paint.STRIKE_THRU_TEXT_FLAG" Watch "problem using Paint.STRIKE_THRU_TEXT_FLAG" New topic

problem using Paint.STRIKE_THRU_TEXT_FLAG

Dov Ezra

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?



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