wagnerouter
New Member
I want to add XML layout (For performing Form submission) as a child item in Expandable listview. I am not able to add using arraylist. Please help me. Thanks in advance .. This is my main Activity public class MainActivity extends ExpandableListActivity implements OnChildClickListener {\[code\]@Overridepublic void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); ExpandableListView expandbleLis = getExpandableListView(); expandbleLis.setDividerHeight(2); expandbleLis.setGroupIndicator(null); expandbleLis.setClickable(true); setGroupData(); setChildGroupData(); NewAdapter mNewAdapter = new NewAdapter(groupItem, childItem); mNewAdapter .setInflater( (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE), this); getExpandableListView().setAdapter(mNewAdapter); expandbleLis.setOnChildClickListener(this);}public void setGroupData() { groupItem.add("abcd"); groupItem.add("efgh");}ArrayList<String> groupItem = new ArrayList<String>();ArrayList<Object> childItem = new ArrayList<Object>();public void setChildGroupData() { /** * Add first child items */ ArrayList<String> child = new ArrayList<String>(); child.add("Java"); child.add("Drupal"); childItem.add(child); /** * Add second child items (here I want to add a xml Layout as a child item for form submission purpose) */ child = new ArrayList<String>(); child.add("Android"); child.add("Blackberry"); childItem.add(child);}@Overridepublic boolean onChildClick(ExpandableListView parent, View v, int groupPosition, int childPosition, long id) { Toast.makeText(MainActivity.this, "Clicked On Child", Toast.LENGTH_SHORT).show(); return true;}\[/code\]}