A
A
Alexx_Sh2017-08-10 16:37:30
Android
Alexx_Sh, 2017-08-10 16:37:30

How to solve the problem with native ads in RecyclerView?

I'm trying to add native ads to the RecyclerView using this example and I'm having problems after I tried to add ads to the list under index "6". When you turn on the application, the list moves to the first advertisement, i.e. to position "6", although in theory without touching it should remain at the very beginning.
PS Perhaps it's not entirely clear what I explained here, so I'll leave this video here . In the video, I turn on the application and after a few seconds the list moves to the first ad and I have to manually move to the top of the list

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexx_Sh, 2017-08-11
@Alexx_Sh

In general, I found the solution myself. As it turned out, a similar problem when the RecyclerView scrolls to the first ad exists on some versions of the android support lib. And in order to solve this problem, you need to add this attribute - to the RecyclerView layout. This line means that all children from the parent's layout will not receive any more attention. android:descendantFocusability="blocksDescendants"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question