Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 13188768 authored by Mangesh Ghiware's avatar Mangesh Ghiware Committed by Android (Google) Code Review
Browse files

Merge "Add methods to return Camera and Gallery launcher intents." into gb-ub-photos-carlsbad

parents a5457743 9149879d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -26,7 +26,7 @@ public class CameraActivity extends Activity {
    @Override
    public void onCreate(Bundle icicle) {
        super.onCreate(icicle);
        Intent intent = IntentHelper.CAMERA_LAUNCHER_INTENT;
        Intent intent = IntentHelper.getCameraIntent(CameraActivity.this);
        // Since this is being launched from a homescreen shorcut,
        // it's already in a new task. Start Camera activity and
        // reset the task to its initial state if needed.
+1 −1
Original line number Diff line number Diff line
@@ -26,7 +26,7 @@ public class Gallery extends Activity {
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        Intent intent = IntentHelper.GALLERY_LAUNCHER_INTENT;
        Intent intent = IntentHelper.getGalleryIntent(Gallery.this);
        // Since this is being launched from a homescreen shortcut,
        // it's already in a new task. Start Gallery activity and
        // reset the task to its initial state if needed.
+9 −4
Original line number Diff line number Diff line
@@ -15,13 +15,18 @@
 */
package com.android.gallery3d.util;

import android.content.Context;
import android.content.Intent;

public class IntentHelper {

    public static final Intent CAMERA_LAUNCHER_INTENT = new Intent(Intent.ACTION_MAIN)
    public static Intent getCameraIntent(Context context) {
        return new Intent(Intent.ACTION_MAIN)
            .setClassName("com.android.camera2", "com.android.camera.CameraActivity");
    }

    public static final Intent GALLERY_LAUNCHER_INTENT = new Intent(Intent.ACTION_MAIN)
    public static Intent getGalleryIntent(Context context) {
        return new Intent(Intent.ACTION_MAIN)
            .setClassName("com.android.gallery3d", "com.android.gallery3d.app.GalleryActivity");
    }
}