使用带有CordovaWebView的setWebViewClient时出现问题

Mys*_*icϡ 5 android cordova cordovawebview

我需要在Phonegap应用程序中提供一些帮助.

CordovaWebView我的应用程序中有一个.我需要从我的html(根据jQuery Mobile页面结构有多个页面)加载一个特定的页面,所以我这样使用loadUrl:

cWebView.loadUrl("file:///android_asset/www/index.html#some-page-id");
Run Code Online (Sandbox Code Playgroud)

这很好用.我能够看到some-page-id.

现在我需要补充WebViewClientcWebView.如果我这样做,我收到错误,并且webl中没有加载网址.

码:

cWebView.setWebViewClient(new MyCordovaWebViewClient(this, cWebView));

public class MyCordovaWebViewClient extends CordovaWebViewClient {

    public MyCordovaWebViewClient(CordovaInterface cordova,
            CordovaWebView view) {
        super(cordova, view);
        // TODO Auto-generated constructor stub
    }

    @Override
    public void onPageFinished(WebView view, String url) {
        // TODO Auto-generated method stub
        Log.d(TAG, "my page finished " + url);
        super.onPageFinished(view, url);
    }
}
Run Code Online (Sandbox Code Playgroud)

错误:

Application Error: A network error occurred. (file:///android_asset/www/index.html#some-page-id)
Run Code Online (Sandbox Code Playgroud)

如果我只是加载index.html,而没有给出具体的页面ID,那么我就不会遇到任何问题setWebViewClient.

任何setWebViewClient与特定页面ID 一起使用的解决方案?