Caused by java.lang.NullPointerException: Attempt to invoke virtual method 'int android.graphics.Bitmap.getWidth()' on a null object reference

后端 未结 6 678
忘了有多久
忘了有多久 2021-02-07 01:46

I have BitmapScalingHelper.java:

public class BitmapScalingHelper
{
    public static Bitmap decodeResource(Resources res, int resId, int dstWidth, int dstHeigh         


        
6条回答
  •  余生分开走
    2021-02-07 02:15

    Your are using: Bitmap decodeFile (String pathName) This method may return null if the decode of file fail. I think that it can be related to permission issue on some device or to image format not supported. If you are using GIF, try https://developer.android.com/reference/android/graphics/Movie.html

提交回复
热议问题