Как решить проблему с просмотром списка: не весь код выполняетсяAndroid

Форум для тех, кто программирует под Android
Ответить
Anonymous
 Как решить проблему с просмотром списка: не весь код выполняется

Сообщение Anonymous »


I have this 3 lines of code which I use to hold the state of items in my listview when scrolling, but my problem is, the last line of code only gets executed. This is the code block:

holder.viewName.setTextColor((priority.equals("Low")? Color.BLUE: Color.GRAY ) ); holder.viewName.setTextColor((priority.equals("Medium")? Color.GREEN: Color.GRAY ) ); holder.viewName.setTextColor((priority.equals("High")? Color.RED: Color.GRAY ) ); // items in this state condition only gets executed in the listview, the rest are ignored and set to gray. Is there a way I can join the code logic together, so that all 3 conditions can be called?


Источник: https://stackoverflow.com/questions/419 ... s-executed
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

Вернуться в «Android»