Advertisement
Guest User

Untitled

a guest
Jun 25th, 2016
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. sendImageFromFolder.setOnClickListener(new View.OnClickListener() {
  2. @Override
  3. public void onClick(View view) {
  4. Intent intent = new Intent();
  5. intent.setType("image/*");
  6. intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true);
  7. intent.setAction(Intent.ACTION_GET_CONTENT);
  8. startActivityForResult(Intent.createChooser(intent,"Select Picture"), 1);
  9.  
  10. }
  11. });
  12.  
  13. protected void onActivityResult(int requestCode, int resultCode, Intent data) {
  14. super.onActivityResult(requestCode, resultCode, data);
  15.  
  16. if(requestCode==1) {
  17. Uri uri = data.getData();//how to convert this uri to real path .
  18. }
  19.  
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement