keinabel keinabel - 1 month ago 14
Android Question

How to access the "DONE" button when holding Android horizontically?

I have an editText field where the user is supposed to enter keys and a button that is supposed to start a background task (see screenshot).

enter image description here

But when I enter landscape mode, the button disappears and is replaced by a

DONE
Button.

enter image description here

So, now I need to either know, how to access this
DONE
button to tell the app to stop the background task or make my
BUTTON
reappear again.

Can you provide me with info on any of these?

Answer

In the landscape mode, your IME went to full screen. In order to avoid that, you can add to the xml file: android:imeOptions="flagNoExtractUi"

or take a look at this Stackoverflow's Q/A and solution from there:

@Override
public InputConnection onCreateInputConnection(EditorInfo outAttrs) {
    outAttrs.imeOptions = EditorInfo.IME_FLAG_NO_EXTRACT_UI;
}