This commit is contained in:
hyb1996 2017-12-30 17:22:20 +08:00
parent 403e19f568
commit fba9f0b4e9

View File

@ -2,6 +2,7 @@ package com.stardust.scriptdroid.ui.widget;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
@ -205,7 +206,12 @@ public class EWebView extends FrameLayout implements SwipeRefreshLayout.OnRefres
if (url.startsWith("http://") || url.startsWith("https://") || url.startsWith("file://")) {
view.loadUrl(url);
} else {
getContext().startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url)));
try {
getContext().startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url)));
} catch (ActivityNotFoundException e) {
e.printStackTrace();
return false;
}
}
return true;
}