Advertisement
Guest User

Untitled

a guest
Sep 4th, 2015
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. try {
  2. Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
  3. Uri uri = Uri.fromFile(File.createTempFile("image", ".jpg"));
  4. cameraIntent.putExtra(android.provider.MediaStore.EXTRA_OUTPUT, uri);
  5. startActivityForResult(Intent.createChooser(cameraIntent, "Take Picture"), 0);
  6. } catch(Exception e) {
  7. Log.e("", Log.getStackTraceString(e));
  8. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement