Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-392

android show/hidekeyboar events not triggered when fullscreen app

    XMLWordPrintableJSON

Details

    Description

      java code:
      public void onCreate(Bundle b) {
      super.onCreate(b);
      super.loadUrl("file:///android_asset/index.html");

      int flags = WindowManager.LayoutParams.FLAG_FULLSCREEN;
      int mask = flags | WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN;
      getWindow().setFlags(flags, mask);
      }

      js code:
      document.addEventListener('deviceready', function () {
      document.addEventListener('showkeyboard', function () {
      console.log('showkeyboard event triggered');
      });
      document.addEventListener('hidekeyboard', function () {
      console.log('hidekeyboard event triggered');
      });
      });

      The code works as expected commenting the setFlags method, but using the setFlags method inside javacode the app is completely fullscreen, but events are never raised.
      looking at the console, when the keyboard appears I can see:
      // showkeyboard
      03-27 15:54:21.566: D/SoftKeyboardDetect(6922): Ignore this event
      03-27 15:54:21.613: V/SoftKeyboardDetect(6922): We are in our onMeasure method
      03-27 15:54:21.613: V/SoftKeyboardDetect(6922): Old Height = 800
      03-27 15:54:21.613: V/SoftKeyboardDetect(6922): Height = 800
      03-27 15:54:21.613: V/SoftKeyboardDetect(6922): Old Width = 480
      03-27 15:54:21.613: V/SoftKeyboardDetect(6922): Width = 480
      03-27 15:54:21.613: D/SoftKeyboardDetect(6922): Ignore this event

      // hidekeyboard
      03-27 15:54:41.984: V/SoftKeyboardDetect(6922): We are in our onMeasure method
      03-27 15:54:41.988: V/SoftKeyboardDetect(6922): Old Height = 800
      03-27 15:54:41.996: V/SoftKeyboardDetect(6922): Height = 800
      03-27 15:54:42.000: V/SoftKeyboardDetect(6922): Old Width = 480
      03-27 15:54:42.011: V/SoftKeyboardDetect(6922): Width = 480
      03-27 15:54:42.011: D/SoftKeyboardDetect(6922): Ignore this event

      Hope this helps

      Attachments

        Activity

          People

            bowserj Joey Robert Bowser
            d_guidi Diego Guidi
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: