diff options
author | Andrew Dolgov <[email protected]> | 2016-02-05 19:05:50 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2016-02-05 19:05:50 +0300 |
commit | 895e87c2a3547604763e069d66bb2989c16755f5 (patch) | |
tree | 2219089ed72afe747445380df0a5335805963e92 /org.fox.ttrss | |
parent | 0683ba9ab3e3e22443bbc145a188d2f17fef3c7f (diff) |
openUri: do not crash if something went wrong
Diffstat (limited to 'org.fox.ttrss')
-rwxr-xr-x | org.fox.ttrss/src/main/java/org/fox/ttrss/CommonActivity.java | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/org.fox.ttrss/src/main/java/org/fox/ttrss/CommonActivity.java b/org.fox.ttrss/src/main/java/org/fox/ttrss/CommonActivity.java index a8536555..65c97d10 100755 --- a/org.fox.ttrss/src/main/java/org/fox/ttrss/CommonActivity.java +++ b/org.fox.ttrss/src/main/java/org/fox/ttrss/CommonActivity.java @@ -309,7 +309,12 @@ public class CommonActivity extends ActionBarActivity implements SharedPreferenc CustomTabsIntent intent = builder.build(); - intent.launchUrl(this, uri); + try { + intent.launchUrl(this, uri); + } catch (Exception e) { + e.printStackTrace(); + toast(e.getMessage()); + } } } @@ -358,7 +363,12 @@ public class CommonActivity extends ActionBarActivity implements SharedPreferenc Intent intent = new Intent(Intent.ACTION_VIEW, uri); - startActivity(intent); + try { + startActivity(intent); + } catch (Exception e) { + e.printStackTrace(); + toast(e.getMessage()); + } } }); @@ -386,7 +396,11 @@ public class CommonActivity extends ActionBarActivity implements SharedPreferenc } else { Intent intent = new Intent(Intent.ACTION_VIEW, uri); - startActivity(intent); + try { + startActivity(intent); + } catch (Exception e) { + toast(e.getMessage()); + } } } |