Skip to content
Advertisement

Android: set fixed item on RecyclerView

I have a RecyclerView, when I click in the first view it adds another view like in the image, what I want is to set the “add” view which ID is “1” to be fixed in the last position of the recycler instead in the first. enter image description here

My adapter:

JavaScript

In the activity:

JavaScript

Advertisement

Answer

I solved it by creating a custom adapter that allows a footer and a header, here is the project in GitHub: https://github.com/u3breeze/android-RecyclerView-WithHeaderAndFooter

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement