i have an image uri and i want to convert this uri to real path .i looked lot of of ans.. but no one worked for me .i'm using marshmallow 6.0.1 in this image uri look like "content://com.android.providers.media.documents/document/image%3A52530".
sendImageFromFolder.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent();
intent.setType("image/*");
intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true);
intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(Intent.createChooser(intent,"Select Picture"), 1);
}
});
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if(requestCode==1) {
Uri uri = data.getData();//how to convert this uri to real path .
}
}
Aucun commentaire:
Enregistrer un commentaire