我有一個屏幕,我必須在屏幕上顯示兩個相似的圖像。這兩個圖像的大小是動態的,但它們覆蓋了大部分屏幕。當我在我的應用程序中導航到此屏幕時,在AndroidStudio的Memory Monitor中看到一個12MB的尖峯,這意味着這兩個圖像都使用了12MB,因爲在該屏幕上沒有其他UI元素,並且這兩個圖像都是相似的,的屏幕空間,我想每個顯示時都會消耗6MB的內存。這兩個圖像的尺寸爲1174 x 1174
我每次載入名爲ProductActivity一定的活動,我會遇到以下錯誤: Fatal Exception: java.lang.OutOfMemoryError: Failed to allocate a 15694612 byte allocation with 2874400 free bytes and 2MB until OOM
at dalvik.system.VMRunt