Operate the image itself. Try not to use setimagebitmap, setimageresource, bitmapfactory. decoderesource to set a large image, because these methods are completed through the createbitmap on the Java layer after the decode is completed, requiring more memory consumption. Therefore, use bitmapfactory first. the decodestream method creates a bitmap and sets it as the source of imageview. The biggest secret of decodestream is that it directly calls JNI> nativedecodeasset () to complete decode, you no longer need to use the createbitmap on the Java layer, thus saving the Java Layer Space. If the configuration parameter of the slice is added during reading, the loaded memory can be reduced more effectively to prevent memory exceptions from being thrown. In addition, decodestream directly reads bytecode from images and does not automatically adapt to various machine resolutions. After decodestream is used, it must be in hdpi and mdpi, configure the corresponding image resources in ldpi. Otherwise, the images are of the same size (number of pixels) on machines with different resolutions. The displayed size is incorrect.