Is it possible to open keyboard on Android without click or touch event? For example just after appending textarea to some element? element.focus() works for me on iOS but not on Android.
Simply add "requestFocus" to your XML. Something like
<EditText
android:id="@+id/editText"
... />
<requestFocus />
and in onCreate()
this.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);
Or: It could be just
editText.requestFocus();
this.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With