layout - "Canvas: trying to draw too large bitmap" when Android N Display Size set larger than Small -
i have published app crashing @ startup on android n when newly introduced display size
os setting set large value.
when in logcat, see following message:
java.lang.runtimeexception: canvas: trying draw large(106,975,232 bytes) bitmap.
i've traced issue imageview in first activity shows nice big background image. image in question 2048x1066 , in generic drawables
directory, no matter density, image used.
everything works okay when display size
setting small
. when go default
, stops working. if swap image out smaller one, works @ default
, if go large
, stops working again.
my guess adjusting display size
causes device behave physically smaller device higher pixel density. don't understand i'm supposed here. if put in progressively smaller images progressively higher resolutions, won't on large displays. or not understanding something?
any pointers appreciated.
i case, moving (hi-res) splash bitmap drawable drawable-xxhdpi solution.
i had same problem. didn't suspect splash screen problem, since is displayed when app started, turned out splash screen problem.
the splash screen in case has xxhdpi resolution, , mistakenly placed in drawable folder, instead of drawable-xxhdpi. made android assume splash screen had mdpi resolution , scale image 3*3 times it's required size , trying create bitmap.
Comments
Post a Comment