Created
May 31, 2014 22:02
-
-
Save snadjafi/682892fe8890054a6a65 to your computer and use it in GitHub Desktop.
start camera actvity
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Intent imageIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE); | |
String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss").format(new Date()); | |
String filePath = Environment.getExternalStoragePublicDirectory( | |
Environment.DIRECTORY_DCIM).toString()+"/Camera"; | |
File rootFolder = new File(filePath); | |
File image = new File(rootFolder, "bp_" + timeStamp + ".png"); | |
Uri uriSavedImage = Uri.fromFile(image); | |
imageIntent.putExtra(MediaStore.EXTRA_OUTPUT, uriSavedImage); | |
startActivityForResult(imageIntent, CAMERA_PIC_REQUEST); | |
// save image to gallery | |
// MediaStore.Images.Media.insertImage(getContentResolver(), b, Shot, NAME); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment