Recyclable twice! Runtime exception in TypedArray

I am getting crash reports from devices using android preview, problem

Caused by: java.lang.RuntimeException: [17, ...... ] recycled twice!
       at android.content.res.TypedArray.recycle(


Can't see the code because Android L is still not available. How to check if TypedArray is overloaded?

I did find that the recycle call gets called twice, but why throw an exception anyway, now breaking potentially old working code (even if it's wrong to call the recycle twice).


source to share

1 answer

Due to changes in the pool in TypedArray in L, calling TypedArray.recycle () twice or calling getter in TypedArray after recycle () is unsafe. This was never the correct behavior for the application, and before L may have introduced subtle bugs.



All Articles