0

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:

  1. I can not implement it in my MainActivity.
  2. 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

Community
  • 1
  • 1
RealDream
  • 407
  • 3
  • 6
  • 18

0 Answers0