Is using android:view_state constant considered a good practice?

257 Views Asked by At

Currently I'm using android:view_state constant to retrieve SparseArray with views states.

It is reccomended way to do this or I should put my separate values to Bundle (eg. position of ViewPager)?

1

There are 1 best solutions below

0
On

Why do you want to use VIEW_STATE_TAG: "android:view_state"? Check below article. It explains how you should save a state of your own view. https://trickyandroid.com/saving-android-view-state-correctly/

You can extend ViewPager and override onSaveInstanceState and onRestoreInstanceState to achieve that.