Is it possible to detect the state of the softkeyboard using the android:windowSoftInputMode="adjustNothing"
i have found multiple solutions where either adjustPan
or adjustResize
is required any Help on this?
Asked
Active
Viewed 512 times
1

Dominic D'Souza
- 961
- 2
- 7
- 16
-
What do you mean by "state of the soft keyboard"? – Karakuri Aug 27 '15 at 04:13
-
I want to detect the opening or closing of the softkeyboard...thats what i meant by state – Dominic D'Souza Aug 27 '15 at 04:16
-
I think [this](http://stackoverflow.com/a/16102728/1207921) is the best you can do. Android is sorely lacking APIs for interacting with the soft keyboard at the UI level, beyond just telling it to show or hide. – Karakuri Aug 27 '15 at 04:19
-
I have used this ..but this resizes my layout.. – Dominic D'Souza Aug 27 '15 at 04:24
-
looking for something better – Dominic D'Souza Aug 27 '15 at 04:25
-
You can detect the opening or closing by getting the keyboard shown/hidden status, InputMethodManager imm = (InputMethodManager) getActivity() .getSystemService(Context.INPUT_METHOD_SERVICE); if (imm.isAcceptingText()) { writeToLog("Software Keyboard was shown"); } else { writeToLog("Software Keyboard was not shown"); } – Prokash Sarkar Aug 27 '15 at 05:20
-
You might be able to use [this](http://stackoverflow.com/questions/2150078/how-to-check-visibility-of-software-keyboard-in-android/4737265#4737265). I suggest using the "new answer" - It works quite well (at least with my tests it does) – Ankush Aug 27 '15 at 06:46
-
Ankush the answer you suggested requires adjustResize or adjustPan i need something with adjustNothing – Dominic D'Souza Aug 27 '15 at 08:40
-
Prokash Sarkar....this solution might not be feasable in my case will try and let you know – Dominic D'Souza Aug 27 '15 at 08:41