Hi everyone,
I am trying to do an autocomplete version my way (logic, layout,
etc...) , so I don't want to use the AutoCompleteTextView.
My question is how to set an EditText on top of a ListView in a class
inheriting from a ListAcvitivy.
I tried two kinds of layout, none of them worked.
First one :
<snipset>
<EditText android:id="@+id/autocomplete_server"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:completionThreshold="1"
android:singleLine="true"/>
<ListView android:id="@id/android:list"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#000000"
android:layout_weight="1"
android:drawSelectorOnTop="false"/>
<TextView android:id="@id/android:empty"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#FF0000"
android:text="No data"/>
</snipset>
This one only shows me the EditText but does not display the list
Second one :
<snipset>
<LinearLayout android:id="@id/android:list"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:padding="5dp">
<EditText android:id="@+id/autocomplete_server"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:completionThreshold="1"
android:singleLine="true"/>
<ListView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#000000"
android:layout_weight="1"
android:drawSelectorOnTop="false"/>
</LinearLayout>
</snipset>
This sample gives me a :
java.lang.RuntimeException: Unable to start activity
ComponentInfo{com.eip.core/com.eip.core.Search}:
java.lang.ClassCastException: android.widget.LinearLayout
Does anyone have any idea bout how to implement an EditText on top of
a listView ?
--
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
To unsubscribe, reply using "remove me" as the subject.