我是android的新手,我可以从图库中选择多个图像,但无法执行onActivityResult来获取所有数组或ListView中未包含的任何列表中的所有图像。如果要获取所有选定的图像,如果可能在位图数组中。
这是我的多项选择代码。
private void selectImage1(){
Intent in = new Intent();
in.setType("image/*");
in.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(in,IMG_REQUEST1);
}
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == IMG_REQUEST && resultCode == RESULT_OK && data != null) {
Uri path = data.getData();
try {
// bitmap = MediaStore.Images.Media.getBitmap(getActivity().getContentResolver(), path);
bitmapArray.add(MediaStore.Images.Media.getBitmap(getActivity().getContentResolver(), path));
right1.setImageResource(R.drawable.right);
for(int i=0;i<=bitmapArray.size();i++) {
Log.d("[[[[[[[[[[[", "" + imageToString(bitmapArray.get(i)));
images += imageToString(bitmapArray.get(i)) + "@.#";
Log.d("***********", "" + images);
}
// right1.setImageResource(R.drawable.right);
} catch (IOException e) {
e.printStackTrace();
}