We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mWeb.setWebViewClient(new MyWebViewClient(this){ //加载错误的时候会回调 @OverRide public void onReceivedError(WebView webView, int i, String s,final String s1) { Log.e("---log","onReceivedError i"+i); Log.e("---log","onReceivedError s"+s);
if (s1.startsWith("http")||s1.startsWith("https")||s1.startsWith("ftp")){ super.onReceivedError(webView, i, s, s1); } else { Log.e("---log","onReceivedError"+s1); try { Log.e("---log","try"+s1); runOnUiThread(new Runnable() { @Override public void run() { Intent intent =new Intent(); intent.setAction(Intent.ACTION_VIEW); intent.setData(Uri.parse(s1)); startActivity(intent); } }); }catch (Exception e){ Log.e("---log","catch"+s1); e.printStackTrace(); } } } @Override public boolean shouldOverrideUrlLoading(WebView view, String url) { Log.e("---log",url); if (url.startsWith("http")||url.startsWith("https")||url.startsWith("ftp")){ return super.shouldOverrideUrlLoading(view, url); } else { Log.e("---log",url); try { Intent intent =new Intent(); intent.setAction(Intent.ACTION_VIEW); intent.setData(Uri.parse(url)); startActivity(intent); }catch (Exception e){ Log.e("---log","shouldOverrideUrlLoading catch"); e.printStackTrace(); } return true; } } });
The text was updated successfully, but these errors were encountered:
No branches or pull requests
mWeb.setWebViewClient(new MyWebViewClient(this){
//加载错误的时候会回调
@OverRide
public void onReceivedError(WebView webView, int i, String s,final String s1) {
Log.e("---log","onReceivedError i"+i);
Log.e("---log","onReceivedError s"+s);
The text was updated successfully, but these errors were encountered: