The bitmap object returned by Bitmap.decodeFile() is empty

Bitmap is a class widely used for image adaptation, which can convert different forms of images into bits.

Among them, the Bitmap.decodeFile(filepath, options) method can obtain the picture of the specified local path and convert it to bitmap form.

Since I haven't used this method for a long time, the local image acquisition of today's project is always an empty file, and the path is right.

Solution:
In the AndroidManifest.xml file, add the attribute android:requestLegacyExternalStorage="true" in the application tag <application

Guess you like

Origin blog.csdn.net/qq_41904106/article/details/115242785