Note that there are some explanatory texts on larger screens.

plurals
  1. POget correct values in childcursor for clicked group
    primarykey
    data
    text
    <p>I can use <code>SimpleCursorTreeAdapter</code> to create <code>ExpandableListView</code> with correct groupcursors and childcursors. For my program, each child contains three <code>TextView</code>s. When I expand group and click on child, I use custom dialog to show the three values in <code>EditText</code> view. </p> <p>The program is ok if I only open "ONE" group at a time. I can get correct child values if clicked. But if I expand several groups at the same time. It only shows the latest children under latest group. </p> <p>For example: Group A has 3 items, Group B has 5 items, Group C has 2 items. First I clicked on children under Group A, no problem, then children under Group B, no problem, but if I go back to click children under Group A, it still shows child under Group B. I don't know how can show correct children. If I use Toast to display, all children are correct, so strange. What can I do in this methods ?</p> <pre><code>epView.setOnGroupClickListener(new ExpandableListView.OnGroupClickListener() { @Override public boolean onGroupClick(ExpandableListView parent, View v, int groupPosition, long row) { return false; } }); epView.setOnChildClickListener(new ExpandableListView.OnChildClickListener() { @Override public boolean onChildClick(ExpandableListView parent, View v, int groupPosition, int childPosition, long id) { int tempid = childcursor.getInt(0); String temp1 = childcursor.getString(1); String temp2 = childcursor.getString(2); String temp3 = childcursor.getString(3); CustomDialog custom = new CustomDialog(ListCateActivity.this,catecursor,childcursor,temp1,temp2,temp3,tempid); custom.setTitle("Record Information"); custom.show(); Toast.makeText(ListCateActivity.this, "Group:"+String.valueOf(groupPosition).toString()+" Child: "+String.valueOf(childPosition).toString()+temp1+" "+temp2+" "+temp3, Toast.LENGTH_SHORT).show(); return true; } }); </code></pre> <p>thanks !!</p>
    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.
 

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