diff options
author | Christian Schneppe <christian.schneppe@pix-art.de> | 2020-02-06 19:19:19 +0100 |
---|---|---|
committer | Christian Schneppe <christian.schneppe@pix-art.de> | 2020-02-06 19:19:19 +0100 |
commit | 2059bdff818a4023857000fedaeb371744dd44f4 (patch) | |
tree | cf18e9125bcaaffb93dbcc5ed7102aa37a634c67 /src/main/java/de | |
parent | 4611713eca10b7a2867ee97b34450ca26144c51b (diff) |
fix NPE in AboutActivity
Diffstat (limited to '')
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/AboutActivity.java | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/AboutActivity.java b/src/main/java/de/pixart/messenger/ui/AboutActivity.java index 709ba8ee5..0efaa57c1 100644 --- a/src/main/java/de/pixart/messenger/ui/AboutActivity.java +++ b/src/main/java/de/pixart/messenger/ui/AboutActivity.java @@ -5,11 +5,13 @@ import android.net.Uri; import android.os.Bundle; import android.widget.Button; import android.widget.TextView; +import android.widget.Toast; import java.util.Calendar; import de.pixart.messenger.R; import de.pixart.messenger.utils.ThemeHelper; +import me.drakeet.support.toast.ToastCompat; public class AboutActivity extends XmppActivity { @@ -41,15 +43,23 @@ public class AboutActivity extends XmppActivity { privacyButton = findViewById(R.id.show_privacy_policy); privacyButton.setOnClickListener(view -> { - final Uri uri = Uri.parse("https://jabber.pix-art.de/privacy/"); - Intent browserIntent = new Intent(Intent.ACTION_VIEW, uri); - startActivity(browserIntent); + try { + final Uri uri = Uri.parse("https://jabber.pix-art.de/privacy/"); + Intent browserIntent = new Intent(Intent.ACTION_VIEW, uri); + startActivity(browserIntent); + } catch (Exception e) { + ToastCompat.makeText(this, R.string.no_application_found_to_open_link, Toast.LENGTH_SHORT).show(); + } }); termsOfUseButton = findViewById(R.id.show_terms_of_use); termsOfUseButton.setOnClickListener(view -> { - final Uri uri = Uri.parse("https://jabber.pix-art.de/termsofuse/"); - Intent browserIntent = new Intent(Intent.ACTION_VIEW, uri); - startActivity(browserIntent); + try { + final Uri uri = Uri.parse("https://jabber.pix-art.de/termsofuse/"); + Intent browserIntent = new Intent(Intent.ACTION_VIEW, uri); + startActivity(browserIntent); + } catch (Exception e) { + ToastCompat.makeText(this, R.string.no_application_found_to_open_link, Toast.LENGTH_SHORT).show(); + } }); } }
\ No newline at end of file |