Fix ActivityNotFoundException
This commit is contained in:
parent
3611bfe27e
commit
d4e8ff6dd5
|
@ -9,8 +9,8 @@ android {
|
|||
applicationId "com.zane.smapiinstaller"
|
||||
minSdkVersion 19
|
||||
targetSdkVersion 28
|
||||
versionCode 8
|
||||
versionName "1.2.0"
|
||||
versionCode 10
|
||||
versionName "1.2.2"
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
multiDexEnabled true
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package com.zane.smapiinstaller.logic;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.ActivityNotFoundException;
|
||||
import android.content.ClipData;
|
||||
import android.content.ClipboardManager;
|
||||
import android.content.Context;
|
||||
|
@ -107,11 +108,15 @@ public class CommonLogic {
|
|||
}
|
||||
|
||||
public static void openUrl(Context context, String url) {
|
||||
try {
|
||||
Intent intent = new Intent();
|
||||
intent.setData(Uri.parse(url));
|
||||
intent.setAction(Intent.ACTION_VIEW);
|
||||
context.startActivity(intent);
|
||||
}
|
||||
catch (ActivityNotFoundException ignored){
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean copyToClipboard(Context context, String copyStr) {
|
||||
try {
|
||||
|
|
Loading…
Reference in New Issue