Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>What i got is,you need to populate a listview with the records you get in cursor.You are populating your listview in each iteration of for loop and that is what causes problem.i think,following should work for you. (Required changes for varibles should be made accordingly.)</p> <p>Try this:</p> <pre><code>vf = new ViewFlipper(MyCollectionList.this); myListView = new ListView(MyCollectionList.this); array = new ArrayList&lt;Integer&gt;(); hm = new HashMap&lt;String, Object&gt;(); for(cursorTitle.move(0); cursorTitle.moveToNext(); cursorTitle.isAfterLast()) { if (vf != null) { vf.removeAllViews(); } text = cursorTitle.getString(cursorTitle.getColumnIndex("title")); cardsCount = cursorTitle.getString(cursorTitle.getColumnIndex("cardsCount")); collId = Integer.parseInt(cursorTitle.getString(cursorTitle.getColumnIndex("objectId"))); Log.i("CollID","Collection ID : "+collId); b = BitmapFactory.decodeFile("/sdcard/7073d92dce10884554d7e047f1c51cb6.jpg", null); array.add(collId); hm.put(IMAGE, b); hm.put(TITLE, text); hm.put(CARDS_COUNT, cardsCount +" Stampii"); items.add(hm); } final SimpleAdapter adapter = new SimpleAdapter(MyCollectionList.this, items, R.layout.main_listview, new String[]{TITLE, CARDS_COUNT, IMAGE}, new int[]{ R.id.main_name, R.id.main_info, R.id.main_img}); myListView.setAdapter(adapter); myListView.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView&lt;?&gt; a, View v, int position, long id) { Intent previewMessage = new Intent(getParent(), MyCollectionId.class); previewMessage.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); TabGroupActivity parentActivity = (TabGroupActivity)getParent(); previewMessage.putExtra("collection_id", array.get(position)); parentActivity.startChildActivity("MyCollectionId", previewMessage); } </code></pre>
    singulars
    1. This table or related slice is empty.
    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. VO
      singulars
      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