PhoneGap for Android does not accept the 9 key

后端 未结 3 2021
迷失自我
迷失自我 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: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 ...
    }
    

提交回复
热议问题