hi i'm trying put listview inside listview inside listview. problem first listview showing elements correctly. every listview after contains 1 element.
update:
creating own non-scrollable listview fixed problem. https://stackoverflow.com/a/24629341/3713144
here code:
activity_anlagen_details.xml:
<?xml version="1.0" encoding="utf-8"?> <android.support.v4.widget.drawerlayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/drawerlayout" android:layout_width="match_parent" android:layout_height="match_parent" android:elevation="7dp"> <linearlayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <include android:id="@+id/tool_bar" layout="@layout/tool_bar"></include> <textview android:id="@+id/anlagenname_textview" android:layout_width="0dp" android:layout_height="60dp" android:gravity="center|center_vertical" android:padding="3dip" android:singleline="true" android:textappearance="?android:attr/textappearancelarge" /> <view android:layout_width="fill_parent" android:layout_height="4dp" android:background="#424242" /> <listview android:id="@+id/listchecklisten" android:layout_width="match_parent" android:layout_height="wrap_content" /> </linearlayout> <android.support.v7.widget.recyclerview android:id="@+id/recyclerview" android:layout_width="320dp" android:layout_height="match_parent" android:layout_gravity="left" android:background="#ffffff" android:scrollbars="vertical"> </android.support.v7.widget.recyclerview> </android.support.v4.widget.drawerlayout> anlagen_checklisten_listview.xml:
<?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="wrap_content"> <textview android:layout_width="match_parent" android:layout_height="60dp" android:textappearance="?android:attr/textappearancemedium" android:id="@+id/checkliste_name" android:layout_gravity="center_horizontal" android:gravity="center|center_vertical"/> <listview android:id="@+id/listchecklistenpunkte" android:layout_width="match_parent" android:layout_height="wrap_content" /> </linearlayout> and on...
what i'm trying setting arrayadapter listviews:
anlagendetailsactivity:
... long anlagenid = getintent().getlongextra("anlagen_id", 0); log.d(logger, "details anlage: " + anlagenid); localanlagenaccessor accessor = new localanlagenaccessor(this); anlage anlage = accessor.readanlage(anlagenid); textview anlagenname = (textview) findviewbyid(r.id.anlagenname_textview); anlagenname.settext(anlage.getname()); listview listview = (listview) findviewbyid(r.id.listchecklisten); anlagenchecklistenadapter adapter = new anlagenchecklistenadapter(this); listview.setadapter(adapter); adapter.addall(anlage.getchecklisten()); ... anlagenchecklistenadapter:
... @override public view getview(int position, view convertview, viewgroup parent) { layoutinflater inflater = (layoutinflater) context.getsystemservice(context.layout_inflater_service); view checklisteview = inflater.inflate(r.layout.anlagen_checklisten_listview, parent, false); textview checklistename = (textview) checklisteview.findviewbyid(r.id.checkliste_name); checklistename.settext(getitem(position).getart()); listview listview = (listview) checklisteview.findviewbyid(r.id.listchecklistenpunkte); anlagenchecklistenpunktadapter adapter = new anlagenchecklistenpunktadapter(checklisteview.getcontext()); listview.setadapter(adapter); adapter.addall(getitem(position).getchecklistenpunkte()); return checklisteview; } ... the same goes on 1 more listview. doing wrong here?
Comments
Post a Comment