How can I show image in childgroup in expandablelistview?

I think this is useful for you public View getChildView(int groupPosition, int childPosition, boolean isLastChild, View convertView, ViewGroup parent) { View view= getGenericGroupView(groupPosition ,convertView); return view; } public View getGenericGroupView(int groupPosition, View convertView) { // Layout parameters for the ExpandableListView View view=null; try{ AbsListView. LayoutParams lp = new AbsListView. LayoutParams( ViewGroup.LayoutParams.

MATCH_PARENT, 90); view=convertView; Holder holder=new Holder(); if(convertView==null) { LayoutInflater inflator=(LayoutInflater) ExpandableList1.this. GetSystemService(Context. LAYOUT_INFLATER_SERVICE); view=inflator.

Inflate(R.layout. Inflate, null); view. SetLayoutParams(lp); view.

SetPadding(80, 5, 5, 5); holder. Image=(ImageView)view. FindViewById(R.id.

Image); view. SetTag(holder); } else { holder=(Holder) view.getTag(); } holder.image. SetImageResource(R.drawable.

Image); }catch (Exception e) { e.printStackTrace(); // TODO: handle exception } return view; } private class Holder { private ImageView image; }.

I think this is useful for you... public View getChildView(int groupPosition, int childPosition, boolean isLastChild, View convertView, ViewGroup parent) { View view= getGenericGroupView(groupPosition ,convertView); return view; } public View getGenericGroupView(int groupPosition, View convertView) { // Layout parameters for the ExpandableListView View view=null; try{ AbsListView. LayoutParams lp = new AbsListView. LayoutParams( ViewGroup.LayoutParams.

MATCH_PARENT, 90); view=convertView; Holder holder=new Holder(); if(convertView==null) { LayoutInflater inflator=(LayoutInflater) ExpandableList1.this. GetSystemService(Context. LAYOUT_INFLATER_SERVICE); view=inflator.

Inflate(R.layout. Inflate, null); view. SetLayoutParams(lp); view.

SetPadding(80, 5, 5, 5); holder. Image=(ImageView)view. FindViewById(R.id.

Image); view. SetTag(holder); } else { holder=(Holder) view.getTag(); } holder.image. SetImageResource(R.drawable.

Image); }catch (Exception e) { e.printStackTrace(); // TODO: handle exception } return view; } private class Holder { private ImageView image; }.

By using the setImageResource method you get it all done with a one-liner. You do not need the three Integer arrays in your adapter. You also do not need an XML selector for state expanded and collapsed.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions