Created
January 9, 2015 13:18
-
-
Save omegasoft7/c5247c2cae6a08c81951 to your computer and use it in GitHub Desktop.
Take picture and save it
This file contains hidden or 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
btn01.setOnClickListener(new OnClickListener() { | |
@Override | |
public void onClick(View v) { | |
Intent imageIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); | |
File imagesFolder = new File(Environment.getExternalStorageDirectory(), "MyImages"); | |
imagesFolder.mkdirs(); // <---- | |
File image = new File(imagesFolder, "image_001.jpg"); | |
Uri uriSavedImage = Uri.fromFile(image); | |
imageIntent.putExtra(MediaStore.EXTRA_OUTPUT, uriSavedImage); | |
startActivityForResult(imageIntent,0); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment