Keyboard

Android Emulator Keyboard Shortcuts

The table below shows android emulator device key and keyboard shortcut key

Android Device Key
Keyboard Shortcut Key

Home
HOME

Menu (left softkey)
F2 or Page-up button

Star (right softkey)
Shift-F2 or Page Down

Back
ESC

Call/dial button
F3

Hangup/end call button
F4

Search
F5

Po

Android EditorInfo Go, Search, Done, Next Example

There is always necessity to add extra keys apart from default keys available in virtual QWERTY keyboard. For instance we may need a direct search key by the side of edit text box in order to have direct triggering of Search actions.
For Instance to add a Search key we need to add this code, so that It may appear in the QWERTY board.

[sourcecode language="java"]
EditTextSample.setImeOptions(EditorInfo.IME_ACTION_SEARCH);
[/sourcecode]

Android Hide Virtual Keyboard through code

In most situation we are in need to force close the keyboard by pressing the back button. But this can also be done using the following code.
[sourcecode language="java"]
InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(myEditTextName.getWindowToken(), 0);
[/sourcecode]

This key code forces the keyboard to close.

Syndicate content