In android, how do we make the device keypad always visible in the application? The top portion displays the content the application wants to render and bottom portion displays the keypad always.
相关问题
- How can I create this custom Bottom Navigation on
- Bottom Navigation View gets Shrink Down
- How to make that the snackbar action button be sho
- Listening to outgoing sms not working android
- How to create Circular view on android wear?
相关文章
- android开发 怎么把图片放入drawable的文件夹下
- android上如何获取/storage/emulated/下的文件列表
- androidStudio有个箭头不认识
- SQLite不能创建表
- Windows - Android SDK manager not listing any plat
- Animate Recycler View grid when number of columns
- Why is the app closing suddenly without showing an
- Android OverlayItem.setMarker(): Change the marker
You must have an
EditText
in your layout and that need to extentEditText
base class. then OverrideonKeyPreIme()
method, and return True. Now your keyboard will be always visible and can't be dismissed by Back key.Caution: Because of your
onKeyPreIme()
method returnstrue
you can't exit your app using back key.Example:
onKeyPreIme() - Android developer
I found a way that works for me to keep the soft keyboard visible after an edit in my
myEditText
field of classEditText
. The trick is to override theonEditorAction
method so that it returnstrue
or else have
onEditorAction
returntrue
only after the "Done" key-click (IME_ACTION_DONE
) otherwisefalse
(see also this answer on the
onEditorAction
method)Adding
android:windowSoftInputMode="stateAlwaysVisible
to the Manifest file helped to have the soft keyboard shown at activity start but it didn't prevent it from disappearing again whenever the "Done" key was clicked after an edit.Add android:windowSoftInputMode="stateAlwaysVisible" to your activity in the AndroidManifest.xml file:
In my test app this shows the keyboard on starting of the application although it isn't fixed there but can be dismissed by pressing the back button.
To make sure the keyboard is always visible you might have to create your own keyboard as part of the UI of your application. Here is a tutorial to show you how to do this with KeyboardView: http://www.fampennings.nl/maarten/android/09keyboard/index.htm