Guest User

Untitled

a guest
Jan 3rd, 2012
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. // to call camera
  2.  
  3. String _path = Environment.getExternalStorageDirectory()
  4. + File.separator + "TakenFromCamera.png";
  5. File file = new File(_path);
  6. Uri outputFileUri = Uri.fromFile(file);
  7. Intent intent = new Intent(
  8. android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
  9. intent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri);
  10. startActivityForResult(intent, 1212);
  11.  
  12.  
  13. // in activity onResult
  14.  
  15. if (requestCode == 1212) {
  16. String _path = Environment.getExternalStorageDirectory()
  17. + File.separator + "TakenFromCamera.png";
  18. mBitmap = BitmapFactory.decodeFile(_path);
  19. if (mBitmap == null) {
  20. } else {
  21. Intent intent = new Intent(AYGCamActivity.this,
  22. myGalleryImage.class);
  23.  
  24. startActivity(intent);
  25. }
  26.  
  27. }
Advertisement
Add Comment
Please, Sign In to add comment