Note that there are some explanatory texts on larger screens.

plurals
  1. POOnly one row appears in ListActivity
    text
    copied!<p>I am trying to create a ListActivity which its rows contain a text and an image. But It shows only one rows' values the other rows' images and texts are invisible. When I debug the code their values are not null. But it shows the rows but doesn't show these text and image values on layout except the first row. Here is my code : </p> <pre><code>public class SutList extends ListActivity implements XmlListener,OnItemClickListener{ XMLParser xmlParser; @SuppressWarnings("rawtypes") ArrayList sutList = new ArrayList(); ProgressDialog sutProgress; XmlObjectAdapter xmlObj; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); xmlParser = new XMLParser("http://192.168.2.101/eczaplus/AndroidAPI/search.php?searchtype=drug_sut&amp;keyword="+SharedItems.getInstance().clickedObject.map.get("id")); xmlParser.addMyEventListener(this); xmlParser.startAsyncTask(); getListView().setOnItemClickListener(this); } @Override public void xmlParsed(XmlEvent evt) { sutList = evt.ownerClient.children; xmlObj = new XmlObjectAdapter(this, R.layout.esdegerilac, sutList); setListAdapter(xmlObj); } @Override public void preExecute(EventObject evt) { sutProgress = new ProgressDialog(SutList.this); sutProgress.setProgressStyle(ProgressDialog.STYLE_SPINNER); sutProgress = ProgressDialog.show(SutList.this,"", ""); } @Override public void postExecute(EventObject evt) { sutProgress.dismiss(); } private class XmlObjectAdapter extends ArrayAdapter&lt;XmlObject&gt; { private ArrayList&lt;XmlObject&gt; items; public XmlObjectAdapter(Context context, int textViewResourceId, ArrayList&lt;XmlObject&gt; items) { super(context, textViewResourceId, items); this.items = items; } @Override public View getView(int position, View convertView, ViewGroup parent) { View v = convertView; if (v == null) { LayoutInflater vi = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE); v = vi.inflate(R.layout.sutlist, null); } XmlObject o = items.get(position); // System.out.println(o.map.get("name")); if (o != null) { TextView ilacText = (TextView) findViewById(R.id.sutNameText); ImageView sutImage = (ImageView) findViewById(R.id.sutImage); //HashMap&lt; String, String&gt; atr = (HashMap&lt;String, String&gt;) o.map; if (sutImage != null){ if (o.map.get("exists").equals("1")) sutImage.setImageResource(R.drawable.ok); else sutImage.setImageResource(R.drawable.not_ok); if (ilacText != null) ilacText.setText(o.map.get("title")); } } return v; } } </code></pre> <p>Hope you can help me to figure out to solve this problem. </p>
 

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