From 2fbfeacb873fd42c9d3f135926ad5622a02a3d16 Mon Sep 17 00:00:00 2001 From: tonymanou Date: Sun, 5 Aug 2018 20:38:27 +0200 Subject: [PATCH] Show toast when intent to open a link is not resolved --- app/src/full/java/com/topjohnwu/magisk/utils/Utils.java | 3 +++ app/src/full/res/values/strings.xml | 1 + 2 files changed, 4 insertions(+) diff --git a/app/src/full/java/com/topjohnwu/magisk/utils/Utils.java b/app/src/full/java/com/topjohnwu/magisk/utils/Utils.java index 3b2442680..051a8ef94 100644 --- a/app/src/full/java/com/topjohnwu/magisk/utils/Utils.java +++ b/app/src/full/java/com/topjohnwu/magisk/utils/Utils.java @@ -15,6 +15,7 @@ import android.widget.Toast; import com.topjohnwu.magisk.Const; import com.topjohnwu.magisk.Data; import com.topjohnwu.magisk.MagiskManager; +import com.topjohnwu.magisk.R; import com.topjohnwu.magisk.container.Module; import com.topjohnwu.magisk.container.ValueSortedMap; import com.topjohnwu.magisk.services.UpdateCheckService; @@ -94,6 +95,8 @@ public class Utils { intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); if (intent.resolveActivity(context.getPackageManager()) != null) { context.startActivity(intent); + } else { + toast(R.string.open_link_failed_toast, Toast.LENGTH_SHORT); } } diff --git a/app/src/full/res/values/strings.xml b/app/src/full/res/values/strings.xml index 74c185a66..88a205979 100644 --- a/app/src/full/res/values/strings.xml +++ b/app/src/full/res/values/strings.xml @@ -96,6 +96,7 @@ Hiding Magisk Manager… This might take a while… Hide Magisk Manager failed… + No application found to open the link… Download Zip Only Patch Boot Image File Direct Install (Recommended)