從我原來的question後續。ImageView Android內存
有沒有辦法在android應用程序中使用ImageViews而不使用大量RAM?
在原來的question我發現我的應用程序使用了大量的RAM,並且發現它是我用過的所有RAM的ImageViews。
以獲取圖像我用
public void addPictureOnClick(View view){
Intent intent = new Intent();
intent.setType("image/*");
intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(Intent.createChooser(intent, "Select Picture"),1);
}
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
if (resultCode == RESULT_OK) {
if (requestCode == 1) {
// currImageURI is the global variable I'm using to hold the content:// URI of the image
Uri currImageURI = data.getData();
image.setImageURI(currImageURI);
}
我想知道是否有另一種方式來顯示圖片,而不是URI?
有多大你加載圖像,有多少,以及什麼是內存使用,當你使用它們相比,當你不? – DMags 2011-03-17 14:59:08
@DMags:我不知道大小。這是用手機拍攝的照片。 RAM的使用量是4Mb,沒有一張圖片,24Mb的圖片是 – Bastaix 2011-03-17 15:05:47