PhoneGap for Android does not accept the 9 key

后端 未结 3 2020
迷失自我
迷失自我 2020-12-06 05:47

I have a strange problem in my PhoneGap-based android app. On certain screens, the number 9 key is completely ignored. This happens on all my Android 2.X devices. I hav

相关标签:
3条回答
  • 2020-12-06 06:43

    I had the same issue. Turns out that you need to specify the Android SDK version via the API number in the config.xml file

    add: <preference name="android-minSdkVersion" value="8" />

    0 讨论(0)
  • 2020-12-06 06:43

    I have developed a phonegap application in eclipse(for android). I had the same problem. When i pressed on 7, the application stopped and when i press on 9, the application do nothing in the text area components. It was also a problem appears on android versions 2.2 & 2.3.3. In the layout, there were a structure such as frame->frame->linear layout. And then i removed both of the frames. I just used linear layout and then the problem solved. I can press on 7 & 9 and there is no problem in the application. I mean, you should check for the unused layout components.

    0 讨论(0)
  • 2020-12-06 06:48

    It might be related to this issue. For some reason PhoneGap is calling setNavDump on the web view's WebSettings. setNavDump is an obsolete method according to the android docs so you should be fine if you disable it.

    One way to do it is by overriding the init method in your class that extends DroidGap

        @Override
    public void init() {
        super.init();       
        this.appView.getSettings().setNavDump(false);
    }
    

    If that doesn't work, try adding it after the loadUrl call in the existing onCreate method:

    @Override
    public void onCreate(Bundle savedInstanceState) {
        //... snip ...
        super.loadUrl("file:///android_asset/www/index.html", 12000);
        this.appView.getSettings().setNavDump(false);
        //... snip ...
    }
    
    0 讨论(0)
提交回复
热议问题