How can I avoid code duplication when getting data from Firebase (android)?
问题 I'd imagine this question would apply to any application that uses asynchronous calls. I'm relatively new to all this, and the problem I'm having is with with fetching data from Firebase to my Android application. There are several classes throughout the application that need to use data from the "users" table in the database, which I obtain as follows: DatabaseReference reference = FirebaseDatabase.getInstance().getReference() .child("users").child("exampleDataFromUsers"); reference