diff options
author | cyBerta <cyberta@riseup.net> | 2020-05-09 01:24:57 +0200 |
---|---|---|
committer | cyBerta <cyberta@riseup.net> | 2020-06-03 10:35:19 +0200 |
commit | 2b265e3bd54b0e71e0560be6eea3f6450b794e37 (patch) | |
tree | f45c335d5167ff2af3cfddb11f92421617a3bff0 | |
parent | e4d66c554123a33b035b27999f1809593c5b6f17 (diff) |
catch ActivityNotFoundException for the rare case when Android can't find any Activity which is able to open a intent containing a URL
-rw-r--r-- | app/src/main/java/se/leap/bitmaskclient/fragments/DonationReminderDialog.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/app/src/main/java/se/leap/bitmaskclient/fragments/DonationReminderDialog.java b/app/src/main/java/se/leap/bitmaskclient/fragments/DonationReminderDialog.java index d2454d77..046acad4 100644 --- a/app/src/main/java/se/leap/bitmaskclient/fragments/DonationReminderDialog.java +++ b/app/src/main/java/se/leap/bitmaskclient/fragments/DonationReminderDialog.java @@ -1,6 +1,7 @@ package se.leap.bitmaskclient.fragments; import android.app.Dialog; +import android.content.ActivityNotFoundException; import android.content.Context; import android.content.Intent; import android.net.Uri; @@ -57,7 +58,11 @@ public class DonationReminderDialog extends AppCompatDialogFragment { builder.setView(view); btnDonate.setOnClickListener(v -> { Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(DONATION_URL)); - startActivity(browserIntent); + try { + startActivity(browserIntent); + } catch (ActivityNotFoundException e) { + e.printStackTrace(); + } PreferenceHelper.putString(getContext(), LAST_DONATION_REMINDER_DATE, DateHelper.getCurrentDateString()); dismiss(); |