Merge branch 'investigate-activity-not-found' of https://git.secluded.site/cheogram-android

Stephen Paul Weber created

* 'investigate-activity-not-found' of https://git.secluded.site/cheogram-android:
  Show toast when can't open privacy policy

Change summary

src/cheogram/java/eu/siacs/conversations/ui/WelcomeActivity.java | 15 +
1 file changed, 12 insertions(+), 3 deletions(-)

Detailed changes

src/cheogram/java/eu/siacs/conversations/ui/WelcomeActivity.java 🔗

@@ -160,9 +160,18 @@ public class WelcomeActivity extends XmppActivity implements XmppConnectionServi
         binding.buttonNext.setOnClickListener((v) ->
             binding.slideshowPager.setCurrentItem(binding.slideshowPager.getCurrentItem() + 1)
         );
-        binding.buttonPrivacy.setOnClickListener((v) ->
-            startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://cheogram.com/android-privacy.html")))
-        );
+        binding.buttonPrivacy.setOnClickListener(
+                (v) -> {
+                    try {
+                        startActivity(
+                                new Intent(
+                                        Intent.ACTION_VIEW,
+                                        Uri.parse("https://cheogram.com/android-privacy.html")));
+                    } catch (final ActivityNotFoundException e) {
+                        Toast.makeText(this, R.string.no_application_found_to_open_link, Toast.LENGTH_SHORT)
+                                .show();
+                    }
+                });
         configureActionBar(getSupportActionBar(), false);
         binding.registerNewAccount.setOnClickListener(v -> {
             if (hasInviteUri()) {