"Canvas: trying to draw too large bitmap" when Android N Display Size set larger than Small
<p>I have a published app that is crashing at startup on Android N when the newly introduced <code>Display size</code> OS setting is set to too large a value.</p>

<p>When I look in logcat, I see the following message:</p>

<pre><code>java.lang.RuntimeException: Canvas: trying to draw too large(106,975,232 bytes) bitmap.
</code></pre>

<p>I've traced the issue to an ImageView in my first Activity that shows a nice big background image. The image in question is 2048x1066 and is in my generic <code>drawables</code> directory, so no matter the density, this image will be used.</p>

<p>Everything works okay when the <code>Display size</code> setting is <code>Small</code>. But when I go up to <code>Default</code>, it stops working. If I then swap the image out with a smaller one, it works at <code>Default</code>, but if I go up to <code>Large</code>, it stops working again.</p>

<p>My guess is that adjusting <code>Display size</code> up causes your device to behave like a physically smaller device with a higher pixel density. But I don't understand what I'm supposed to do here. If I put in progressively smaller images for progressively higher resolutions, it won't look good on actually large displays. Or am I not understanding something?</p>

<p>Any pointers would be greatly appreciated.</p>