Skip to content

Commit

Permalink
Adding new exception to prevent crash if user have not application to…
Browse files Browse the repository at this point in the history
… consume intent.
  • Loading branch information
SuperBesse committed Sep 24, 2018
1 parent 516fdd2 commit 7fe7853
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,11 @@ public boolean shouldOverrideUrlLoading(WebView webView, String url) {
}

if (openIntent) {
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
webView.getContext().startActivity(intent);
try {
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
webView.getContext().startActivity(intent);
} catch (ActivityNotFoundException e) {}
return true;
}

Expand Down

0 comments on commit 7fe7853

Please sign in to comment.