Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid ExpandableListActivity Change View at runtime
    primarykey
    data
    text
    <p>I am using <code>ExpandableListActivity</code> i am using </p> <pre><code>SimpleExpandableListAdapter(Context context, List&lt;? extends Map&lt;String, ?&gt;&gt; groupData, int groupLayout, String[] groupFrom, int[] groupTo, List&lt;? extends List&lt;? extends Map&lt;String, ?&gt;&gt;&gt; childData, int childLayout, String[] childFrom, int[] childTo); </code></pre> <p>for my activity. Here i have created Context Menu. Using Context Menu i am deleting the value from database and also form <code>ArrayList</code> of <code>Child Group</code>. I am getting problem is i want to update my <code>ChildView</code> of Expandable List Activity immediately after deleting values From <code>DataBase</code> and <code>ArrayList.</code> i tried using <code>notifyDataSetChanged()</code>. It do not work as because i am not deleting the value from ExpandableListAdapter itself. I also tried by calling Adapter again after deleting values but it gives two listviews. </p> <pre><code>// here on select ContextMenu @Override public boolean onContextItemSelected(MenuItem item) { ExpandableListContextMenuInfo info = (ExpandableListContextMenuInfo) item .getMenuInfo(); // Getting positions of Group and child from Expandable ListView int groupPos = 0, childPos = 0; int type = ExpandableListView .getPackedPositionType(info.packedPosition); if (type == ExpandableListView.PACKED_POSITION_TYPE_CHILD) { groupPos = ExpandableListView .getPackedPositionGroup(info.packedPosition); childPos = ExpandableListView .getPackedPositionChild(info.packedPosition); } db.openConnection(this); View v = info.targetView; TextView tv = (TextView) v.findViewById(R.id.grp_child); String string = (String) tv.getText(); // Here I delete the value from DataBase onClik of Context Menu. if (item.getItemId() == 0) { final String where = "title=?"; final String[] args = new String[] { string }; database.delete(tableData, where, args); } // Here I delete the value from ArrayList onClik of Context Menu. //result1 is ArrayList&lt;ArrayList&lt;HashMap&lt;String,String&gt;&gt;&gt;(); result1.get(groupPos).get(childPos); result1.remove(result1.get(groupPos).get(childPos)); Log.e("Search", "is" + result1.get(groupPos).get(childPos)); /*expListAdapter.notifyDataSetChanged();*/ db.closeConnection(); return super.onContextItemSelected(item); // when i delete form both arraylist and database i want to update //ListView immidiately. } </code></pre> <p>Any Help will be appricited.</p> <p>Thanks in Advance..</p> <p>Mahaveer</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