Wednesday 15 May 2013

Suggested text is not displayed in autoCompleteTextBox in android -


As the color suggetsed text text background color and AutoCompleteTextBox Android does not show the same suggetsed text so My XML file is:

  & lt; AutoCompleteTextView android: id = "@ + id / autoCompleteTextView1" Android: layout_width = "0dp" Android: layout_height = "wrap_content" Android: layout_weight = "2.4" Android: Background = "# ffffff" Android: ems = "10" Android: Text collar = "# 000000" & gt; & Lt; / AutoCompleteTextView & gt;   

and my manifest file is:

   & Lt; Application Android: allowBackup = "true" android: icon = "@ drawable / ic_launcher" android: label = "@ string / app_name" android: theme = "@ android: style / Theme.NoTitleBar.Fullscreen" & gt;   

And my Java file was protected saved Crete (bundled zero Instansstet) {super.onCreate (savedInstanceState); SetContentView (R.layout.patient_registration);

  // layout to get a reference to AutoCompleteTextView in AutoCompleteTextView TextView = (AutoCompleteTextView) findViewById (R.id.autoCompleteTextView1); // string arrow string [] Countries = {"Jane", "FB", "Mar", "Jun", "Kokok", "Oppo"}; // Create the adapter and set it to autocomplete the full array for ArrayAdapter & lt; String & gt; Adapter = new array adapter & lt; String & gt; (This, Android .R.Let.CompL_L_Lightime, Country); TextView.setThreshold (1); TextView.setAdapter (adapter); }    

For android.R use instead android.R.layout.simple_dropdown_item_1line try. Layout.simple_list_item_1 - This works for me

No comments:

Post a Comment