I use autocompletetextview with SimpleCursorAdapter to get data from sqlite. I want to start its drop down list with the key entered, in my fully automatic product view, the list is not shown or filtered by input text. For example, if users enter "A", then all the text started with "A" will be seen in this list.
SetContentView (R.layout.new); TxtPNo = (Autocomplete full view view) ViewById (R.id.txtSTo); MDbHelper = New DBAdapter (this); MDbHelper.open (); Simple cursor adapter notes = fill data (); TxtPNo.setAdapter (Notes); } Private Syncers adapter Bharoda data () {Cursor C = MDB on BTech; GateNName (); StartManagingCursor (c); String [] from = new string [] {DBAdapter.Name, DBAdapter.No1}; Int for [] = new int [] {R.id.txtName, R.id.txtNo1}; Log D. (Tag, "cursor .getcount () =" + c.getCount ()); Simple cursor adapter notes = new SimpleCarrier adapter (It, R. Layout. Autosomplete, C, with, from); Return notes; }
new.xml
& lt ;? Xml version = "1.0" encoding = "UTF-8"? & Gt; & Lt; RelativeLayout Android: layout_width = "fill_parent" Android: layout_height = "fill_parent" xmlns: Android = "http://schemas.android.com/apk/res/android" Android: background = "#ffffff" & gt; Android: Android: Android: Android: Android: Android: Android: Android: Android: Android: Android: "It" Android: Ending: Threshold = "1" Android: selectAllOnFocus = "true" android: layout_alignParentTop = "True" android: layout_alignParentLeft = "true" /> & Lt; / RelativeLayout & gt;
autocomplete.xml
& lt ;? Xml version = "1.0" encoding = "UTF-8"? & Gt; & Lt; Android: layout_width = "fill_parent" android: layout_height = "wrap_content" android: stretchColumns = "0" android: padding = "5dp" and "Tabletax" & Gt; & Lt; TableRow Android: padding = "5dp" & gt; & Lt; LinearLayout Android: orientation = "vertical" & gt; & Lt; TextView Android: id = "@ + id / txtName" xmlns: Android = "http://schemas.android.com/apk/res/android" Android: textColor = "# 000000" Android: layout_width = "wrap_content" Android: Layout_height = "wrap_content" /> & Lt; TextView Android: id = "@ + id / txtNo1" xmlns: android = "http://schemas.android.com/apk/res/android" Android: textColor = "# 000000" Android: layout_width = "wrap_content" Android: Layout_height = "wrap_content" /> & Lt; / LinearLayout & gt; & Lt; / TableRow & gt; & Lt; / TableLayout & gt;
How to implement just to get a filtered list?
find TCTPNO = (autocomplete view full) VVBIID (RIDTT) .sts); MDbHelper = New DBAdapter (this); MDbHelper.open (); Simple cursor adapter notes = fill data (); TxtPhoneNo.setAdapter (Notes);
Umm, if you copy-n-paste your code ...
The issue is the variable name.
TxtPNo! = TxtPhoneNo
Comments
Post a Comment