Specifically setHasTransientState(boolean)
. How and why would one use it? I'm looking for a "real life" scenario.
The docs definition:
Set whether this view is currently tracking transient state that the framework should attempt to preserve when possible. This flag is reference counted, so every call to setHasTransientState(true) should be paired with a later call to setHasTransientState(false).
A view with transient state cannot be trivially rebound from an external data source, such as an adapter binding item views in a list. This may be because the view is performing an animation, tracking user selection of content, or similar.
If the view is listview item, setHasTransientState can prevent it from recycling.If it is in animation, it is userful. Transient is just a special state of view, I think it means dont touch me(as recycle),and I will become not transient soon.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With