file:///c:/view/index618.html,无法打开资源URL:file:/// android_asset/activity_a

我刚开始使用android编码,我仍然从错误中学习。我使用WebView加载内部html页面,我想要打开另一个活动窗口,该窗口将是barcode scanner,方法是单击webview上的超链接。不过,我得到这个错误无法打开资源URL:file:/// android_asset/activity_a

Unable to open asset URL: file:///android_asset/activity_a://qrcodeactivity

AndroidManifest.xml中

的index.html

Activity A

MyWebClient的Java

private class MyWebViewClient extends WebViewClient {

@Override

public boolean shouldOverrideUrlLoading(WebView view, String url) {

if (url.equals("activity_a://qrcodeactivity")) {

Intent intent = new Intent(getContext(), qrcodeactivity.class);

startActivity(intent);

return true; // Handle By application itself

} else {

view.loadUrl(url);

if (loader.equals("pull")) {

swipeContainer.setRefreshing(true);

} else if (loader.equals("dialog")) {

if (!pd.isShowing()) {

pd.show();

}

} else if (loader.equals("never")) {

Log.d("WebView", "No Loader selected");

}

return true;

}

}

@Override

public void onPageFinished(WebView view, String url) {

if (pd.isShowing()) {

pd.dismiss();

}

if (swipeContainer.isRefreshing()) {

swipeContainer.setRefreshing(false);

}

}

@Override

public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {

webView.loadUrl("file:///android_asset/" + getString(R.string.error_page));

}

}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值