From 609d8cc0c7d05aa294aeebea8dcbb9111aefc1e1 Mon Sep 17 00:00:00 2001 From: Cheng-Ru Lin Date: Tue, 13 Oct 2009 06:22:55 -0700 Subject: Clear task stack when launch camera with the hardware button. Bug: http://b/issue?id=2109092 Change-Id: Ia9b5cb7dfd6abd5c77e34e408cb761b4145bfd3d --- src/com/android/camera/CameraButtonIntentReceiver.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/com/android/camera/CameraButtonIntentReceiver.java') diff --git a/src/com/android/camera/CameraButtonIntentReceiver.java b/src/com/android/camera/CameraButtonIntentReceiver.java index 0d9c4fb..4153104 100644 --- a/src/com/android/camera/CameraButtonIntentReceiver.java +++ b/src/com/android/camera/CameraButtonIntentReceiver.java @@ -21,8 +21,6 @@ import android.content.Context; import android.content.Intent; public class CameraButtonIntentReceiver extends BroadcastReceiver { - public CameraButtonIntentReceiver() { - } @Override public void onReceive(Context context, Intent intent) { @@ -35,8 +33,9 @@ public class CameraButtonIntentReceiver extends BroadcastReceiver { holder.release(); Intent i = new Intent(Intent.ACTION_MAIN); i.setClass(context, Camera.class); - i.addCategory("android.intent.category.LAUNCHER"); - i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + i.addCategory(Intent.CATEGORY_LAUNCHER); + i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK + | Intent.FLAG_ACTIVITY_CLEAR_TOP); context.startActivity(i); } } -- cgit v1.1