open Camera via Intent - Android android.hardware

Android examples for android.hardware:Open Camera

Description

open Camera via Intent

Demo Code

import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;

public class Main{

    public static void openCamera(Context context) {
        Intent intent = new Intent(); 
        intent.setAction("android.media.action.STILL_IMAGE_CAMERA");
        intent.setFlags(0x34c40000);//from   ww w  .  j  av  a2 s  . c o m
        context.startActivity(intent);
    }

}

Related Tutorials