androidandroid-drawableandroid-bitmapbitmapdrawable

Setting BitmapDrawable tileMode makes the app restart


While on most of the devices my app is working fine, on some devices (LG G3, Samsung Galaxy S6 so far) I have experienced a strange error, I can not really unfold:

Setting tileMode (either via XML or programmatically) to anything (clamp/repeat/mirror) on a BitmapDrawable, that is the backround of a layout, makes that background completely black-, and the app restart after ~20 seconds - without any sign of anything going wrong (no messages in LogCat, none of these callbacks of my activity is called: onPause(), onStop(), onDestroy()).

As there were some inconsistency among these freezes/crashes depending on the Bitmap being used, I started playing around with the .png images, and figured out, that I can get rid of (most of) these crashes, if I reduce the size of these images (<200x200).

Since

I am still looking for a general solution, maybe some of you can help me with.


Solution

  • Although this thread was not exactly about the same problem I had, it helped me accidentally. Setting the layerType of the layout in question to software like

    made the black backgrounds and the app restarts disappear.

    It turned out also, that making the background images smaller didn't solve the problem, it only made it appear less often.

    Thanks for the help pskink anyway!