Vote count:
0
I am trying to select images from android gallery. And here is my code. It works fine with single image. But when if select multiple image its giving me back null. Any idea whats going wrong
Button addNewCart = (Button) findViewById(R.id.imageSelect);
addNewCart.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent( );
intent.setType("image/*");
intent.setAction(Intent.ACTION_GET_CONTENT);
intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true);
startActivityForResult(Intent.createChooser(intent,
"select multiple images"), 100);
}
});
And here is the code for activity
@Override public void onActivityResult(int requestCode, int resultCode, Intent data) { if(resultCode == Activity.RESULT_OK){ String[] all_path = data.getStringArrayExtra("all_path"); if(data != null) {
Uri selectedImageUri = data.getData(); System.out.println(selectedImageUri);
}
}
}
Any ideas ?
Thanks
asked 20 secs ago
multiple image selection from gallery
Aucun commentaire:
Enregistrer un commentaire