Don't crash when no suitable intent found

This commit is contained in:
Daniel Applebaum 2009-08-29 22:55:14 +00:00
parent d50a16c6b4
commit 44a52d54a7
1 changed files with 9 additions and 1 deletions

View File

@ -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();
}
}
}