Get an Activity Manager, and then ask for a package restart:
ActivityManager m_activityManager = (ActivityManager) getSystemService(Activity.ACTIVITY_SERVICE);
And that’s it, it just works.
I know its not recommended, and that it’s against activities lifecycle, but sometimes it is necessary for your app.
If you have a custom EditText, that uses a different input method from soft keyboard, you should add this line to prevent him from showing.
Really easy, huh?
When having EditText as form fields, you might want to navigate from one to another by using the soft keyboard. This is easy if you use the following property in the layout xml:
For inputs that have a “following” element :
For the final item:
There are several options to control the Enter/Next… key in soft keyboard, here are a list of possible values (what do they display and if there is a special action)
- actionDone: Done, hides the soft keyboard if not the last text input box
- actionGo: Go
- actionNone: Enter key simbol, inserts a new line (cursor goes to next line)
- actionNext: Goes to next item, displays “Next” (or equivalent in your language)
- actionSearch: displays a magnifying glass
- actionSend: Send
some image examples (in Spanish locale) for action buttons (for “navigation” you should need next and done):
Search action button
Go Action Button (Ir in Spanish)
Next Action button (Sig. from Siguiente in Spanish locale)
Done Action button (Listo in Spanish locale)
Default Action Button
For further information, you should look at the official documentation page, on Onscreen Inputs