java - How add framelayout in first group listview(ExpandbleListView)? -


i'm trying add first group of new layout. disclosure of groups, new layout appears in other groups. want new layout added in first group expandblelistview. clumsy code adds in groups, , these groups not clickable.

@override public view getgroupview(int groupposition, boolean isexpanded,                          view convertview, viewgroup parent) {     if (convertview == null) {         convertview = inflater.inflate(r.layout.mylistview, parent, false);     }     if(groupposition == 0)     {         linearlayout fl = (linearlayout)convertview.findviewbyid(r.id.mylistview);         view fl2 = inflater.inflate(r.layout.infoday, fl, true);         //fl.addview(fl2);     }     textview textchild = (textview)convertview.findviewbyid(r.id.textview22);     group group = (group)getgroup(groupposition);     textchild.settext(group.string);     return convertview; } 

my list

<?xml version="1.0" encoding="utf-8"?><framelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical">  <expandablelistview     android:id="@+id/explistview"     android:layout_width="match_parent"     android:layout_height="wrap_content"     android:clickable="true"> </expandablelistview> 

my group in list

<?xml version="1.0" encoding="utf-8"?><linearlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="fill_parent" android:layout_height="80dp" android:orientation="vertical" tools:context=".mainactivity" android:id="@+id/mylistview">  <textview     android:layout_width="wrap_content"     android:layout_height="wrap_content"     android:textappearance="?android:attr/textappearancemedium"     android:text="medium text"     android:id="@+id/textview22"     android:textsize="14sp"     android:layout_margintop="20dp"     android:layout_marginleft="35dp" /> 

my new layout, want add

<?xml version="1.0" encoding="utf-8"?><framelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/frameinfoday" android:paddingbottom="10dp">  <imageview     android:layout_width="150dp"     android:layout_height="25dp"     android:id="@+id/imageview2"     android:background="@drawable/day" />  <textview     android:layout_width="wrap_content"     android:layout_height="wrap_content"     android:textappearance="?android:attr/textappearancesmall"     android:text="СУББОТА"     android:id="@+id/textview25"     android:textcolor="#ffffffff"     android:layout_marginleft="25dp"     android:layout_margintop="4dp"     android:textisselectable="true"     android:textsize="11sp" /> 

view headerview = view.inflate(this, r.layout.infoday, null); listview.addheaderview(headerview); 

this work me. add layout in header listview!

more information: add header , footer in listview


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -