Skip to content Skip to sidebar Skip to footer

Firebase Query Result In Listview Ui And Recyclerview Ui

I am trying to create a Firebase database to store employee information and then when an address is queried, all the employees staying in that particular area should be displayed i

Solution 1:

You're creating the adapter inside an OnClickListener(), which means that this points to that listener. You need to pass in the Activity to FirebaseListAdapter, which you can get with MainActivity.this.

Solution 2:

I was having this problem when Firebase upgraded and what i did to get out of the constructor error was change this:

FirebaserootRef=newFirebase("https://<your-app>.firebaseio.com/");

to this:

DatabaseReferencerootRef= FirebaseDatabase.getInstance().getReference();

then use the rootRef as the fourth parameter on the constructor.

here is a link for upgrading from the previous firebase to the current: https://firebase.google.com/support/guides/firebase-android#import_your_project_to_the_new_firebase_console_numbered

Also, upgrade your sdk. Hope this solves your problem

Post a Comment for "Firebase Query Result In Listview Ui And Recyclerview Ui"