Fix crash when opening links.

This commit is contained in:
dosiecki 2015-09-23 14:49:56 -07:00
parent 7aaab803da
commit 7e171ce7d2

View file

@ -53,9 +53,13 @@ public class NewsblurWebview extends WebView {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
Uri uri = Uri.parse(url);
Intent i = new Intent(Intent.ACTION_VIEW);
i.setData(uri);
context.startActivity(i);
try {
Intent i = new Intent(Intent.ACTION_VIEW);
i.setData(uri);
context.startActivity(i);
} catch (Exception e) {
Log.wtf(this.getClass().getName(), "device cannot open URLs");
}
return true;
}
});