From 0c26ead8e953383e7f1498df0dc695e5752df20d Mon Sep 17 00:00:00 2001 From: Neamar Date: Sat, 3 Oct 2015 18:21:58 +0200 Subject: [PATCH] F** me i'm dumbass --- app/src/main/AndroidManifest.xml | 4 ++-- .../main/java/fr/neamar/kiss/result/AppResult.java | 13 ++++++++++++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 60bbd6732..6165896d6 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -2,8 +2,8 @@ + android:versionCode="64" + android:versionName="2.10.1"> diff --git a/app/src/main/java/fr/neamar/kiss/result/AppResult.java b/app/src/main/java/fr/neamar/kiss/result/AppResult.java index dfc343453..4421a3931 100644 --- a/app/src/main/java/fr/neamar/kiss/result/AppResult.java +++ b/app/src/main/java/fr/neamar/kiss/result/AppResult.java @@ -1,6 +1,7 @@ package fr.neamar.kiss.result; import android.annotation.TargetApi; +import android.content.ActivityNotFoundException; import android.content.ComponentName; import android.content.Context; import android.content.Intent; @@ -142,6 +143,16 @@ public Drawable getDrawable(Context context) { @Override public void doLaunch(Context context, View v) { - throw new RuntimeException("LOLILOL"); + Intent intent = new Intent(Intent.ACTION_MAIN); + intent.addCategory(Intent.CATEGORY_LAUNCHER); + intent.setComponent(className); + intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED); + + try { + context.startActivity(intent); + } catch (ActivityNotFoundException e) { + // Application was just removed? + Toast.makeText(context, R.string.application_not_found, Toast.LENGTH_LONG).show(); + } } }