通过单击一个按钮,我从图库中获取图像并将其设置到图像视图中......这是代码......
protected void onActivityResult(int requestCode, int resultCode, Intent data)
{
super.onActivityResult(requestCode, resultCode, data);
if(requestCode==RESULT_LOAD_IMAGE && resultCode == RESULT_OK && null != data)
{
Uri selectedImage = data.getData();
String[] filePathColumn = { MediaStore.Images.Media.DATA };
Cursor cursor = getContentResolver().query(selectedImage,
filePathColumn, null, null, null);
cursor.moveToFirst();
int columnIndex = cursor.getColumnIndex(filePathColumn[0]);
String picturePath = cursor.getString(columnIndex);
cursor.close();
ImageView imageView = (ImageView) findViewById(R.id.iImage);
imageView.setImageBitmap(BitmapFactory.decodeFile(picturePath));
}
}
现在我想在位图变量中获取此图像,并需要将其作为位图变量添加到数组列表中......有人可以帮助我吗?