PhoneGap: How do I get appView's id and pass it around?

前端 未结 1 649
忘了有多久
忘了有多久 2021-01-25 08:00

For PhoneGap Application, as the instruction said, I have replaced the setContentView() line with super.loadUrl(\"file:///android_asset/www/index.html\");

相关标签:
1条回答
  • 2021-01-25 08:25

    First you should not take the approach of adding your own JS interface. It is better if you write a PhoneGap plugin:

    http://docs.phonegap.com/en/2.0.0/guide_plugin-development_android_index.md.html#Developing%20a%20Plugin%20on%20Android

    We've already suffered through all the pains of making sure the JS interfaces are setup correctly. From your plugin you can get access to appView by using:

    this.webView
    

    Yes, appView is the only webview in PhoneGap.

    0 讨论(0)
提交回复
热议问题