Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

EditText and MultiAutoCompleteTextView suggestions

I'm using a MultiAutoCompleteTextView in my app to show various suggestions.

I noticed that MultiAutoCompleteTextView doesn't support the regular android suggerstion that come defaultly with an EditText (the strip of suggestions that pops above the soft keyboard.

Is there a way of showing both the regular suggestions, and the ones I want to show in my MultiAutoCompleteTextView?

like image 981
Ofer Avatar asked Dec 29 '10 07:12

Ofer


People also ask

What is the difference between AutoCompleteTextView and MultiAutoCompleteTextView?

Difference Between AutoCompleteTextView and MultiAutoCompleteTextView. An AutoCompleteTextView only offers suggestion about the whole text. But MultiAutoCompleteTextView offers multiple suggestions for the substring of the text.

What is the difference between EditText and TextView?

EditText is used for user input. TextView is used to display text and is not editable by the user. TextView can be updated programatically at any time.

How do I set autocomplete text on android?

If you want to get suggestions , when you type in an editable text field , you can do this via AutoCompleteTextView. It provides suggestions automatically when the user is typing. The list of suggestions is displayed in a drop down menu from which the user can choose an item to replace the content of the edit box with.

What is the basic use of EditText control?

XML Attributes of Edittext in AndroidUsed to specify how to align the text like left, right, center, top, etc. Used to set size of the text. Used to set color of the text. Used to set style of the text.


1 Answers

I found that setting the input types only took effect when I set them with setRawInputType(). I also found out that the only way to use InputType.TYPE_TEXT_FLAG_AUTO_CORRECT was to include include InputType.TYPE_CLASS_TEXT also. So it would result in something like this:

multiAutoCompleteTextView.setRawInputType(InputType.TYPE_CLASS_TEXT
  |InputType.TYPE_TEXT_FLAG_CAP_SENTENCES
  |InputType.TYPE_TEXT_FLAG_AUTO_CORRECT
  |InputType.TYPE_TEXT_FLAG_MULTI_LINE);
like image 200
HandlerExploit Avatar answered Oct 23 '22 09:10

HandlerExploit