我正在开发Android中的PhoneGap应用程序。 在某些情况下,应用程序通过互联网连接到外部网页。 由于用户可能点击网页中的链接并转到不允许的网站,我需要跟踪cordova webview url的更改。 所以,有一种方法可以获得我们与PhoneGap连接的网址?如何在android phonegap应用程序中获取webview url?
代码示例:
public class MyPhoneGapActivity extends DroidGap
{
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
super.init();
super.clearCache();
super.clearHistory();
super.appView.getSettings().setAppCacheEnabled(false);
super.loadUrl("http://www.google.com");
String WebViewUrl = ??
//I need WebViewUrl = "http://www.google.com"
}
}