From af616dbc79c686af831f8ad8bd407418948f40a6 Mon Sep 17 00:00:00 2001 From: Greg Alexander Date: Wed, 16 May 2018 18:06:21 -0400 Subject: [PATCH] fix crash from ActivityNotFoundException when note 7 user attempts to view documentation --- src/org/galexander/sshd/SimpleSSHD.java | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/src/org/galexander/sshd/SimpleSSHD.java b/src/org/galexander/sshd/SimpleSSHD.java index bf18ad2..84aaf8f 100644 --- a/src/org/galexander/sshd/SimpleSSHD.java +++ b/src/org/galexander/sshd/SimpleSSHD.java @@ -78,9 +78,22 @@ public class SimpleSSHD extends Activity reset_keys(); return true; case R.id.doc: { - Intent i = new Intent(Intent.ACTION_VIEW); - i.setData(Uri.parse("http://www.galexander.org/software/simplesshd")); - startActivity(i); + try { + Intent i = new Intent(Intent.ACTION_VIEW); + i.setData(Uri.parse("http://www.galexander.org/software/simplesshd")); + startActivity(i); + } catch (Exception e) { + new AlertDialog.Builder(this) + .setCancelable(true) + .setPositiveButton("OK", + new DialogInterface.OnClickListener() { + public void onClick(DialogInterface di, int which) { } + }) + .setIcon(android.R.drawable.ic_dialog_info) + .setTitle("no browser") + .setMessage("YOU: a note 7 owner with no browser installed on your android?\nME: an app developer who keeps getting crash reports and wants to hear your story. email nobrowserdroid@galexander.org") + .show(); + } } return true; case R.id.about: { AlertDialog.Builder b = new AlertDialog.Builder(this);