Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Soft Keyboard opens then closes in clicking edittext

I have a Recyclerview and one of the items has an edittext , but everytime i clcik on field to start typing the Soft Keyboard opens then closes right away. Has anyone experienced this before ?

like image 894
yosrah Avatar asked Oct 25 '16 15:10

yosrah


People also ask

How do I hide the soft keyboard on Android after clicking outside EditText?

Ok everyone knows that to hide a keyboard you need to implement: InputMethodManager imm = (InputMethodManager) getSystemService(INPUT_METHOD_SERVICE); imm. hideSoftInputFromWindow(getCurrentFocus(). getWindowToken(), 0);

How do I hide soft keyboard when EditText is focused?

setShowSoftInputOnFocus(false); to disable the software keyboard showing when the EditText is touched. the hideKeyboard(this); call in OnCreate to forcible hide the software keyboard.


1 Answers

Maybe a little too late but I've just had this issue. I solved by adding android:windowSoftInputMode="adjustPan" to YourActivity in AndroidManifest.xml, like:

<activity android:name=".YourActivity" android:windowSoftInputMode="adjustPan"/>
like image 69
anakandrat Avatar answered Oct 16 '22 20:10

anakandrat