Skip to content

armgit / core

Public Imported from GitHub
0

100% open-source IoT Platform - Integrate your devices, add intelligence, build custom apps

#85 fix to launch the proper activity

Michael Rademaker719a46940093
diff --git a/console/android/src/main/java/org/openremote/android/ORMessagingActionService.java b/console/android/src/main/java/org/openremote/android/ORMessagingActionService.java
index 4e2a98068..7eb865120 100644
--- a/console/android/src/main/java/org/openremote/android/ORMessagingActionService.java
+++ b/console/android/src/main/java/org/openremote/android/ORMessagingActionService.java
@@ -62,9 +62,7 @@ public class ORMessagingActionService extends IntentService {
// Do silent HTTP request
tokenService.executeRequest(httpMethod, appUrl, data);
} else {
- Intent activityIntent = new Intent("android.intent.action.MAIN");
- activityIntent.setAction(Intent.ACTION_MAIN);
- activityIntent.addCategory(Intent.CATEGORY_LAUNCHER);
+ Intent activityIntent = getApplicationContext().getPackageManager().getLaunchIntentForPackage(getApplicationContext().getPackageName());
activityIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK |
Intent.FLAG_ACTIVITY_SINGLE_TOP);
activityIntent.putExtra("appUrl", appUrl);