I'm using the FirebaseRecyclerAdapter to display a list of announcements to students in a university app training project I'm working on. The data is stored in the folowing structure:
each student has a department, year and a language field
each announcement has a targeted department, year and language
my goal is to only display the announcements that are targetted to the currently logged in student, but I couldn't find a way to perform such query in firebase database.
fetching all the announcements wouldn't cause any privacy issues, so I thought of filtering the data in the FirebaseRecyclerAdapter. I saw (this) answer that implements a Filterable then calls the FirebaseRecyclerAdapter.getFilter().filter() method to do the filtering. However, I need to run the filter() method automatically everytime more data is fetched from the database and I have no idea how to do this.