Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>try</p> <pre><code>View view = convertView; </code></pre> <p>instead of:</p> <pre><code>View view = super.getView(position, convertView, parent); </code></pre> <p><strong>Edited:</strong></p> <pre><code>@Override public View getView(int position, View convertView, ViewGroup parent) { View view = convertView; if(view == null){ LayoutInflater inflater = (LayoutInflater) getActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE); view = inflater.inflate(R.layout.your_layout, null); } // i have a listitem.xml wich lays-out each row in the list. // several textviews are hidden. // i check these hidden textviews on specific text. // if it has the text, we change the background of a specific column item. TextView c1 = (TextView) view.findViewById(R.id.c1); String c1_text=(String)a.getText(); TextView Columnitema = (TextView) view.findViewById(R.id.Columnitema); if(c1_text.equals("YES")) { Columnitema.setBackgroundColor(0xFFe10000); Columnitema.setTextColor(0xFFFFFFFF); } else if(c1_text.equals("NO")) { Columnitema.setBackgroundColor(0xFFff9600); Columnitema.setTextColor(0xFFFFFFFF); } TextView c2 = (TextView) view.findViewById(R.id.c2); String c2_text=(String)c2.getText(); TextView Columnitemb = (TextView) view.findViewById(R.id.Columnitemb); if(c2_text.equals("PERHAPS")) { Columnitemb.setBackgroundColor(0xFFe10000); Columnitemb.setTextColor(0xFFFFFFFF); } else if(c2_text.equals("ABSOLUTELY")) { Columnitemb.setBackgroundColor(0xFFff9600); Columnitemb.setTextColor(0xFFFFFFFF); } TextView c3 = (TextView) view.findViewById(R.id.c3); String c3_text=(String)c3.getText(); TextView Columnitemc = (TextView) view.findViewById(R.id.Columnitemc); if(c3_text.equals("PERHAPS")) { Columnitemc.setBackgroundColor(0xFFe10000); Columnitemc.setTextColor(0xFFFFFFFF); } else if(c3_text.equals("ABSOLUTELY")) { Columnitemc.setBackgroundColor(0xFFff9600); Columnitemc.setTextColor(0xFFFFFFFF); } } return view; } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload