Guest User

Untitled

a guest
Jan 21st, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
  2. takePictureIntent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(f));//without this line the intent is ok
  3. startActivityForResult(takePictureIntent, actionCode);
  4.  
  5. File f = new File("valid path");
  6.  
  7. File file = new File(dataFile);
  8. Uri outFileUri = Uri.fromFile(file);
  9. Intent intent = new Intent("android.media.action.IMAGE_CAPTURE");
  10. intent.putExtra(MediaStore.EXTRA_OUTPUT, outFileUri);
  11. startActivityForResult(intent, TAKE_PHOTO);
Add Comment
Please, Sign In to add comment