android - How am I getting a "Cannot draw recycled bitmaps" exception without ever calling recycle in code? -


my imageview defined in activity layout , there's no listview or gridview, there's no automatic view recycling here. whenever activity loads crash "java.lang.illegalargumentexception: cannot draw recycled bitmaps" in logcat. here's style imageview. can see there's nothing special here. thing notable image it's pretty large (full screen size nexus 10). know view culprit since commenting out resolves error.

<style name="tabletbackground">     <item name="android:scaletype">centercrop</item>     <item name="android:src">@drawable/loading_background</item>     <item name="android:contentdescription">background image</item>     <item name="android:layout_width">fill_parent</item>     <item name="android:layout_height">fill_parent</item> </style> 

nowhere in code activity call recycle bitmaps made. idea what's going on here?

here's of layout curious.

<?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android"     xmlns:tools="http://schemas.android.com/tools"     android:id="@+id/container"     style="@style/news_act_root" >      <imageview         style="@style/tabletbackground"         android:id="@+id/tabletbackground" />      <!-- redacted --> </relativelayout> 

(edited. original guess caused alias misleading , confusing reading this.)

well looks stumbled on solution.

i referenced same drawable in displayed activity , did recycle there. shouldn't cause error, right? does.

so don't expect layout inflater give new drawable. may give 1 inflated if 1 available.


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

CSS3 Transition to highlight new elements created in JQuery -