Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

recycled twice! Runtime Exception in TypedArray

I'm receiving some crash reports from devices using android L preview, the issue is

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

Can't see the code because Android L is still not available, How can I check if the TypedArray is already recycled?

I actually found that the call to recycle is called twice, but anyway, why throw a exception now breaking potentially old working code (even if it's incorrect to call recycle twice).

like image 261
Jokin Avatar asked Jun 27 '26 18:06

Jokin


1 Answers

Due to changes in TypedArray pooling in L, calling TypedArray.recycle() twice or calling a getter on TypedArray after recycle() is not safe. This has never been correct app behavior and prior to L may have introduced subtle errors.

like image 143
alanv Avatar answered Jun 29 '26 09:06

alanv



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!