【发布时间】:2013-08-20 11:43:14
【问题描述】:
我创建了一个 android 应用程序,它从图库中选择一张图片并显示预览。
@Override
public void onClick(View v) {
if (v.getId()== R.id.button){
Intent intent = new Intent();
intent.setType("image/*");
intent.setAction(Intent.ACTION_PICK);
startActivityForResult(Intent.createChooser(intent,
"Select Picture"), SELECT_PICTURE);
}
选择图像后,应显示预览。
然而,它只是第一次工作。后来当我点击返回时,它显示outOfMemoryException
【问题讨论】:
-
你的图片可能很大,你不要尝试显示相同的缩略图
标签: java android bitmap out-of-memory