Skip to content

Commit

Permalink
Workaround for crash when external browser refuses to handle link
Browse files Browse the repository at this point in the history
  • Loading branch information
QuantumBadger committed Jul 11, 2015
1 parent 2b2bb6c commit f07419a
Showing 1 changed file with 7 additions and 3 deletions.
Expand Up @@ -156,9 +156,13 @@ public void run() {
}

public static void openWebBrowser(Activity activity, Uri uri) {
final Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(uri);
activity.startActivity(intent);
try {
final Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(uri);
activity.startActivity(intent);
} catch(Exception e) {
General.quickToast(activity, "Failed to open url \"" + uri.toString() + "\" in external browser");
}
}

public static final Pattern imgurPattern = Pattern.compile(".*imgur\\.com/(\\w+).*"),
Expand Down

0 comments on commit f07419a

Please sign in to comment.