OSDN Git Service

cmfm: create new activity stack when opening a new external intent
authorJorge Ruesga <jorge@ruesga.com>
Fri, 27 Jun 2014 22:00:14 +0000 (00:00 +0200)
committerJorge Ruesga <jorge@ruesga.com>
Fri, 27 Jun 2014 22:00:14 +0000 (00:00 +0200)
This change creates a new stack for the activity opened, so CMFM will not
be linked to the new activity

Change-Id: Ibbdc48d706698b296e27f49272e811d47d54a905
Signed-off-by: Jorge Ruesga <jorge@ruesga.com>
src/com/cyanogenmod/filemanager/ui/policy/IntentsActionPolicy.java

index 852d298..4d687df 100644 (file)
@@ -375,7 +375,7 @@ public final class IntentsActionPolicy extends ActionsPolicy {
             // Create the intent that will handle the shortcut
             Intent shortcutIntent = new Intent(ctx, ShortcutActivity.class);
             shortcutIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
-            shortcutIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);
+            shortcutIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
             if (FileHelper.isDirectory(fso)) {
                 shortcutIntent.putExtra(
                         ShortcutActivity.EXTRA_TYPE,ShortcutActivity.SHORTCUT_TYPE_NAVIGATE);
@@ -471,6 +471,10 @@ public final class IntentsActionPolicy extends ActionsPolicy {
                         Intent.ACTION_VIEW);
             }
             intent.setAction(a);
+        } else {
+            // Create a new stack for the activity
+            intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+            intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
         }
         return intent;
     }