Advertisement
Guest User

Untitled

a guest
Mar 30th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. Intent intent = new Intent(Intent.ACTION_PICK,
  2. MediaStore.Images.Media.INTERNAL_CONTENT_URI);
  3. intent.setType("image/*");
  4. intent.putExtra("crop", "true");
  5. intent.putExtra("scale", true);
  6. intent.putExtra("outputX", 256);
  7. intent.putExtra("outputY", 256);
  8. intent.putExtra("aspectX", 1);
  9. intent.putExtra("aspectY", 1);
  10. intent.putExtra("return-data", true);
  11.  
  12. startActivityForResult(intent, code);
  13.  
  14. if (requestCode == RESULT_LOAD_IMAGE && data != null) {
  15.  
  16. final Bundle extras = data.getExtras();
  17. if (extras != null) {
  18. //Get image
  19. Bitmap profilePicBitmap = extras.getParcelable("data");
  20. ...
  21.  
  22. data.getData()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement