summaryrefslogtreecommitdiff
path: root/app/src/main/java/de/danoeh/antennapod/activity
diff options
context:
space:
mode:
authorByteHamster <info@bytehamster.com>2019-09-25 15:00:33 +0200
committerByteHamster <info@bytehamster.com>2019-09-25 15:00:33 +0200
commitb65c688b53779f436062d33517f95b2c0a29733c (patch)
treead9f655e28189741e88b13caa65d6e3895d003ca /app/src/main/java/de/danoeh/antennapod/activity
parenta92123340da7a3f7286adfd8510c868fec030d4e (diff)
downloadAntennaPod-b65c688b53779f436062d33517f95b2c0a29733c.zip
Fixed crash if there is no browser installed
Diffstat (limited to 'app/src/main/java/de/danoeh/antennapod/activity')
-rw-r--r--app/src/main/java/de/danoeh/antennapod/activity/AboutActivity.java4
-rw-r--r--app/src/main/java/de/danoeh/antennapod/activity/BugReportActivity.java13
-rw-r--r--app/src/main/java/de/danoeh/antennapod/activity/MediaplayerActivity.java3
3 files changed, 5 insertions, 15 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/activity/AboutActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/AboutActivity.java
index 1bcdada44..821e2f347 100644
--- a/app/src/main/java/de/danoeh/antennapod/activity/AboutActivity.java
+++ b/app/src/main/java/de/danoeh/antennapod/activity/AboutActivity.java
@@ -15,6 +15,7 @@ import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.LinearLayout;
+import de.danoeh.antennapod.core.util.IntentUtils;
import org.apache.commons.io.IOUtils;
import java.io.IOException;
@@ -57,8 +58,7 @@ public class AboutActivity extends AppCompatActivity {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
if (url.startsWith("http")) {
- Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
- startActivity(browserIntent);
+ IntentUtils.openInBrowser(AboutActivity.this, url);
return true;
} else {
url = url.replace("file:///android_asset/", "");
diff --git a/app/src/main/java/de/danoeh/antennapod/activity/BugReportActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/BugReportActivity.java
index 32694a74e..7df973f9b 100644
--- a/app/src/main/java/de/danoeh/antennapod/activity/BugReportActivity.java
+++ b/app/src/main/java/de/danoeh/antennapod/activity/BugReportActivity.java
@@ -1,19 +1,16 @@
package de.danoeh.antennapod.activity;
-import android.content.ActivityNotFoundException;
import android.content.ClipData;
import android.content.ClipboardManager;
import android.content.Context;
-import android.content.Intent;
-import android.net.Uri;
import android.os.Bundle;
import android.support.design.widget.Snackbar;
import android.support.v7.app.AppCompatActivity;
import android.widget.TextView;
-import android.widget.Toast;
import de.danoeh.antennapod.CrashReportWriter;
import de.danoeh.antennapod.R;
import de.danoeh.antennapod.core.preferences.UserPreferences;
+import de.danoeh.antennapod.core.util.IntentUtils;
import org.apache.commons.io.IOUtils;
import java.io.File;
@@ -45,13 +42,7 @@ public class BugReportActivity extends AppCompatActivity {
}
findViewById(R.id.btn_open_bug_tracker).setOnClickListener(v -> {
- try {
- Intent myIntent = new Intent(Intent.ACTION_VIEW,
- Uri.parse("https://github.com/AntennaPod/AntennaPod/issues"));
- startActivity(myIntent);
- } catch (ActivityNotFoundException e) {
- Toast.makeText(this, R.string.pref_no_browser_found, Toast.LENGTH_LONG).show();
- }
+ IntentUtils.openInBrowser(BugReportActivity.this, "https://github.com/AntennaPod/AntennaPod/issues");
});
findViewById(R.id.btn_copy_log).setOnClickListener(v -> {
diff --git a/app/src/main/java/de/danoeh/antennapod/activity/MediaplayerActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/MediaplayerActivity.java
index eefa35500..91c3796af 100644
--- a/app/src/main/java/de/danoeh/antennapod/activity/MediaplayerActivity.java
+++ b/app/src/main/java/de/danoeh/antennapod/activity/MediaplayerActivity.java
@@ -452,8 +452,7 @@ public abstract class MediaplayerActivity extends CastEnabledActivity implements
}
break;
case R.id.visit_website_item:
- Uri uri = Uri.parse(getWebsiteLinkWithFallback(media));
- startActivity(new Intent(Intent.ACTION_VIEW, uri));
+ IntentUtils.openInBrowser(MediaplayerActivity.this, getWebsiteLinkWithFallback(media));
break;
case R.id.share_link_item:
if (feedItem != null) {