[在此处输入图片描述] [1]
[1 camera B tn . set On Click Listener(new View . On Click Listener() {
@Override
public void on Click(View view) {
Intent gallery Intent = new Intent(Intent.ACTION_GET_CONTENT);
gallery Intent .set Type("images/*");//This means anything to related image then perform action
start Activity For Result(gallery Intent, GALLERY_CODE);
}
});
protected void on Activity Result(int request Code, int result Code, @ Null able Intent data) {
super.on Activity Result(request Code, result Code, data);
if (request Code==GALLERY_CODE && result Code==RESULT_OK && data!=null && data.get Data()!=null){
Ur i u r i = data.get Data();
try {
Bitmap bitmap = Media Store.Images.Media .get Bitmap(get Content Resolver(),u r i);
image B tn. set Image Bitmap(bitmap);
} catch (File Not Found Exception e) {
e.print Stack Trace();
} catch (IO Exception e) {
e. print Stack Trace();
}
}
}
]:
ht t p s://i.stack。我问你com / F u S a R. j pg 这是网址,请删除它,然后查看我的问题图片。
....谢谢...