Position is inconsistent for the header
See original GitHub issueI found another issue, the position is inconsistent for the header view holder.
The method getFlexibleAdapterPosition()
returns -1 sometimes for the header click events also the getAdapterPosition() returns -1
For reference inside HeaderItem.HeaderViewHolder
in the onClick() event.
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Header Footer Inconsistencies - Microsoft Community
I am trying to add/modify the header for a document to be all the same. I was able to do this by adding...
Read more >Page Header/Footer inconsistent positioning
The centre of the Page-Header almost appears to align to the center of the CPH. The CPH is set to the right edge...
Read more >Position Fixed Not Working for Header - Stack Overflow
I am trying to create a very simple effect where the navigation sticks to the top of the page as you scroll down...
Read more >Issue with positioning the footer text and footer rule - TeX
Consider this MWE, why is the footer rule position different on page 1 compared to the rest of the pages?
Read more >2588883 - Company logo position is inconsistent across pages
Symptom. Position of company logo on header is on the left side in the home page and on the right side in other...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Process: , PID: 30489 java.lang.IndexOutOfBoundsException: Inconsistency detected. Invalid view holder adapter positionViewHolder{9a846b6 position=30 id=-1, oldPos=0, pLpos:0 scrap [attachedScrap] tmpDetached no parent} at android.support.v7.widget.RecyclerView$Recycler.validateViewHolderForOffsetPosition(RecyclerView.java:4505) at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:4636) at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:4617) at android.support.v7.widget.LinearLayoutManager$LayoutState.next(LinearLayoutManager.java:1994) at android.support.v7.widget.GridLayoutManager.layoutChunk(GridLayoutManager.java:528) at android.support.v7.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1353) at android.support.v7.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:574) at android.support.v7.widget.GridLayoutManager.onLayoutChildren(GridLayoutManager.java:170) at android.support.v7.widget.RecyclerView.dispatchLayoutStep1(RecyclerView.java:2979) at android.support.v7.widget.RecyclerView.dispatchLayout(RecyclerView.java:2904) at android.support.v7.widget.RecyclerView.consumePendingUpdateOperations(RecyclerView.java:1482) at android.support.v7.widget.RecyclerView.access$400(RecyclerView.java:147) at android.support.v7.widget.RecyclerView$1.run(RecyclerView.java:294) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:858) at android.view.Choreographer.doCallbacks(Choreographer.java:670) at android.view.Choreographer.doFrame(Choreographer.java:603) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:844) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:148) at android.app.ActivityThread.main(ActivityThread.java:5551) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:730) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:620)
When i fill the adapter it works perfect, but when i finish the activity or call onbackpressed() this error shows up every time. The id is also -1, so i thought maybe this is the same bug.
My error above has nothing to do with this issue, it get triggered by an bug in my own code.
But, it happened to me. I doesn’t know why?