Android - Seemingly harmless layout causes app to crash after short use without any errors

*爱你&永不变心* 提交于 2019-12-06 03:55:25
Whelch

This previous SO post answer solved my issue.

In short, it was the BitmapDrawable that was causing the entire issue. While unfortunately I cannot say why this fixes the issue, setting the view that uses the bitmap with layerType="software" will prevent the crashes.

  • In a layout: android:layerType="software"
  • In code: view.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!