Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to show AutoCompleteTextView suggestions in landscape orientation

AutoCompleteTextView displays it's suggestions in a dropdown in the portrait mode.I would like to display suggestions either in a dialog or in a dropdown in the landscape mode,here the EditText and the keyboard go full screen.

Which layout should I use in the Adapter to display hints as a dialog in landscape mode. Im currently using android.R.layout.simple_dropdown_item_1line.

like image 536
vamsiampolu Avatar asked Nov 11 '13 12:11

vamsiampolu


2 Answers

@vamsiampolu answer is correct but if you want to use same by using java, you can use

    itemautoTxt.setImeOptions(EditorInfo.IME_FLAG_NO_EXTRACT_UI);

where itemautoTxt is AutoCompleteTextView

hope this will helpful to others.

like image 63
AMAN SINGH Avatar answered Sep 30 '22 13:09

AMAN SINGH


In the layout where you defined your AutoCompleteTextView use android:imeOptions=flagNoExtractUi

The flag prevents the element from going full-screen when it is rotated to landscape mode.

like image 32
vamsiampolu Avatar answered Sep 30 '22 12:09

vamsiampolu