Skip to content
This repository has been archived by the owner on Oct 25, 2024. It is now read-only.

Save view state with id = -1 #270

Open
BraisGabin opened this issue Oct 12, 2017 · 0 comments
Open

Save view state with id = -1 #270

BraisGabin opened this issue Oct 12, 2017 · 0 comments

Comments

@BraisGabin
Copy link

Why is a view with id 0 a View with no id but a view with id -1 is treated as View with id?

As far as I can see in the documentation View.NO_ID is -1. Even more, reading the source code Android ignores the state of any view with no id:

    protected void dispatchSaveInstanceState(SparseArray<Parcelable> container) {
        if (mID != NO_ID && (mViewFlags & SAVE_DISABLED_MASK) == 0) {
            // stuff
        }
    }

I'm not sure if this is a bug or I'm missing something...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant