api 23 and below BitmapFactory.decodeResources(getResources(),R.drawable.image); null error

Asked 1 years ago, Updated 1 years ago, 114 views

As a result of the test, we received the bitmap image normally in api24 or higher Below 23 the bitmap will enter null.Is it the difference in version? So how can we solve it?

android bitmap

2022-09-21 12:13

1 Answers

First, the method returns an IllegalArgumentExceptionException.

Please check if you can catch it with try catch.

Second, it may be caused by the image file being too large. Please experiment with a small image.


2022-09-21 12:13

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.