I want to prevent soft keypad from hiding from edittext
while click on send button in my messaging app like in whatsapp while we click on send button but softkeypad
does not disappear I have tried to requestfocus
on edit text
and showing keypad but it shakes keypad like it goes down and then come up. Please can any one help me regarding this issue.
Try this in onCreate
, it will forcely open softkeyboard-
((InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE)).toggleSoftInput(InputMethodManager.SHOW_FORCED, InputMethodManager.HIDE_IMPLICIT_ONLY);
To hide it, use below code-
((InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE)).hideSoftInputFromWindow(_pay_box_helper.getWindowToken(), 0)
In your manifest-
<activity android:windowSoftInputMode="stateAlwaysVisible" ... />
Give android:nextFocusDown to same EditText id.
<EditText
android:id="@+id/loginPassword"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:hint="@string/password"
android:imeOptions="actionSend"
android:nextFocusDown="@id/loginPassword"
android:inputType="textPassword" />
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