I am building an app with a similar layout as Venmo where there are three ViewPagers (Home, Friends, Public) that each display data from Firebase in a continuously updating view. My initial idea was to use a RecyclerView from the FirebaseUI library but several questions related to mine say that this is not possible since Firebase does not work well with fragments. I was wondering if this was still the case as the questions were several years old.
I already have the ViewPager set up and working properly and even have a RecyclerView populated with CardViews. However, they are not getting data from Firebase. I was using this SO answer to try and acheive my goal How to display data from Firestore in a RecyclerView with Android? but ran into a problem when implementing the FirebaseRecyclerOptions object. This code is inside my onCreateView method of my fragments:
FirebaseRecyclerOptions<Post> options = new FirebaseRecyclerOptions.Builder<Post>()
.setQuery(query,Post.class)
.build();
The error that I am getting is "Cannot resolve method 'setQuery()."
I assume that the issue is Post.class cannot be called in a fragment but I am unsure how else to call it. I may be doing this in the completely wrong way but appreciate any help.