Skip to content
Advertisement

Why is the RecyclerView inflating over the ToolBar?

I’m having an issue with my app when I inflate an recyclerview. Inside the recyclerview, some cards are inflated and when it comes out to the screen, the toolbar disappears and the settings button can’t be used.

Using the latest SDK and libraries versions.

activity_main.xml:

JavaScript

linha.xml -> here I get the cardview which I use to show the items on the recyclerview

JavaScript

MainActivity.java

JavaScript

ItemRssViewHolder.java

JavaScript

RssAdapter.java

JavaScript

Advertisement

Answer

Issue fixed with the help of Vishnu, who’s answered this question. It seems the problem was that I was creating a new recycleview on the main activity instead of using the recycleview defined by the layout xml file. To fix that, it was only necessary to remove two lines from the main activity:

JavaScript

And maintain only the first definition of the recycleview, as follows:

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