I have code in which I want to detect the soft keyboard shown or hidden.
I saw here How to check visibility of software keyboard in Android? an answer from Reuben Scratton, but I have troble with the following points:
- I can not implement it in my MainActivity.
The XML file gives the ERROR:
java.lang.ClassCastException: com.android.layoutlib.bridge.android.BridgeContext cannot be cast to android.app.Activity
How can i solve these problems?
Thanks