Android Best way to convert byte array to Bitmap?

前端 未结 4 1794
挽巷
挽巷 2021-01-04 12:49

I know why OutOfMemoryError Exception occurs.But there are any best way to convert byte array to Bitmap.And I used below code ,But when large byte it force close app and giv

4条回答
  •  天命终不由人
    2021-01-04 13:43

    Bitmap bitmap = BitmapFactory.decodeByteArray(bitmapbytes , 0, bitmapbytes .length);
    

    Returns The decoded bitmap, or null if the image could not be decode.

提交回复
热议问题