On Android devices that use soft keyboards, I want to prevent the fullscreen keyboard editing view (shown below) from appearing when in landscape mode (i.e. I want to see only the soft keyboard itself and my view behind it).
I assume this can be achieved using the setExtractViewShown(false)
method on InputMethodService
, but I am unable to access the default instance of this and do not want to implement a custom input method.
Edited to add: the view to which input is going is not a TextView
(it's a View
with a custom InputConnection
implementation), so android:imeOptions="flagNoExtractUi"
won't work here.
Use
android:imeOptions="flagNoFullscreen"
to achieve that feature.add the property
android:imeOptions="flagNoExtractUi"
to eachEditText
in yourXML
file.To do that simply navigate to activity xml and paste
android:imeOptions="flagNoExtractUi"
in your code. Hmm pretty simple - but where the hac it should be pasted? Have look at code of example activity xml and look at EditText:If you want more customisation options for the keyboard see http://developer.android.com/guide/topics/ui/controls/text.html
I know it's a little bit late but for anyone who is still interested, here is my solution : In my case I had a landscape Activity containing an EditText at top of it and I needed to implement autocomplete feature in this search Activity, which the overlapping keyboard caused an issue that the user could not see result of RecyclerView. So I ended up having this EditText in my layout:
Cheers!
If you're modifying the IME directly you can prevent it from ever displaying an ExtractedView by overriding
onUpdateExtractingVisibility
:You can call to hide soft keyboard and clear focus from searchview.