From 44a52d54a78576157779859ffae2b9147f78be00 Mon Sep 17 00:00:00 2001 From: Daniel Applebaum Date: Sat, 29 Aug 2009 22:55:14 +0000 Subject: [PATCH] Don't crash when no suitable intent found --- src/com/android/email/activity/MessageView.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/com/android/email/activity/MessageView.java b/src/com/android/email/activity/MessageView.java index cd5ed9ad1..3060db042 100644 --- a/src/com/android/email/activity/MessageView.java +++ b/src/com/android/email/activity/MessageView.java @@ -1282,7 +1282,15 @@ public class MessageView extends K9Activity Intent intent = new Intent(Intent.ACTION_VIEW); intent.setData(uri); intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); - startActivity(intent); + try + { + startActivity(intent); + } + catch (Exception e) + { + Toast toast = Toast.makeText(MessageView.this, e.getMessage(), Toast.LENGTH_LONG); + toast.show(); + } } }