I want to ask how to add ads between items in recyclerviewusing firebaseUI Recycler Adapter in Android? For example I want to put ads every 5 items in the list.
Asked
Active
Viewed 936 times
3
-
What had you tried so far? ... seems like basic math with items count and shiting the position ... example for [BaseAdapter](https://stackoverflow.com/questions/33264304/listview-with-customadapter-not-updated-when-notifydatasetchanged-is-called/33267776#33267776) ... with basic programming skills you should be able to "translate" this code to RecyclerAdapter/FirebaseRecyclerAdapter – Selvin Nov 03 '16 at 14:28
-
Because I use FirebaseRecyclerAdapter, I tried to addView directly from the RecyclerView with index, but return error – j.elmer Nov 03 '16 at 14:31
-
You're going to want to abandon the Firebase UI recycler adapter and roll your own. That way you can retrieve your data from Firebase DB and pop your ads in where appropriate. There is a good deal more overhead but in the long run it should prove more manageable. Here are some links that might help out: http://antonioleiva.com/recyclerview/ https://firebase.google.com/docs/database/android/lists-of-data – ProgrammingPope Nov 03 '16 at 17:13