using an xml layout as a list item (android ui)

C4YOU

New Member
I have two layout xml files, main.xml, and netframe.xmlthis is the relevant bit of the main:\[code\]<ScrollView android:id="@+id/scrollView1" android:layout_width="fill_parent" android:layout_height="fill_parent" > <LinearLayout android:id="@+id/networkList" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > </LinearLayout></ScrollView>\[/code\]and this is netframe\[code\]<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/frame" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical"> <TextView android:id="@+id/ssid" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textAppearance="?android:attr/textAppearanceLarge" android1:text="SSID" /> <RelativeLayout android1:id="@+id/deviceLine" android:layout_width="fill_parent" android:layout_height="wrap_content" > <TextView android:id="@+id/textView2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text=" " android:textAppearance="?android:attr/textAppearanceMedium" /> <TextView android:id="@+id/bssid" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentTop="true" android:layout_toRightOf="@+id/textView2" android:text="BSSID" android:textAppearance="?android:attr/textAppearanceMedium" /> <TextView android:id="@+id/strength" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentRight="true" android:layout_alignParentTop="true" android:text="Strength" android:textAppearance="?android:attr/textAppearanceMedium" /> </RelativeLayout> <ImageView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/seperator" android:layout_width="fill_parent" android:layout_height="wrap_content" android:paddingBottom="2dp" android:paddingLeft="5dp" android:paddingRight="5dp" android:paddingTop="2dp" android:scaleType="fitXY" android:src="http://stackoverflow.com/questions/11406327/@android:drawable/divider_horizontal_dark" /></LinearLayout>\[/code\]when using layoutinflater, that all words fine and dandy, but I can't edit the text. or, if i try to, nothing from netframe.xml shows up anymore. Am I missing something?when i use this code:\[code\]LinearLayout frame=(LinearLayout)inflater.inflate(R.layout.netframe, null);//TextView ssid=(TextView)netStalker.findViewById(R.id.ssid);//String tmp=item.getSSID();//ssid.setText(tmp);\[/code\]it all shows properly, except with the default xml text. if i uncomment, nothing at all shows.
 
Back
Top