As we know there is no multi query option to firebase realtime database, so instead of using default FirebaseRecycler methods I am trying to manually feed keys from arraylist to the recycler view. In order to sort specific keys on the basis specific child nodes of the given parent I wrote below logic. If I try to individually log the
Tag: firebase
How to check recyclerview is empty or not using dataSnapshot.hasChildren()
I am using firebasedatabase to show my data into recyclerview. I want to show simple toast when my recyclerview is empty and i am using dataSnapshot.hasChildren() for checking the database haschildren or not. here is code when data is available the dataSnapshot.hasChildren() giving true value but when no data available else condition is not working Answer you can use dataSnapshot.getChildrenCount()
How to make addListenerForSingleValueEvent to work in loop?
I’m trying to access the addListenerForSingleValueEvent for a specific number of times based on the amount of item’s present in cart but since it listen’s for only one time I’m unable to fetch the …
Trying to retrieve data from Firebase and get this error: SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length
The database I build an application and I’m trying to retrieve user info from Firebase. After the registration form, I have a new activity where the users need to write their personal info and that information is stored in firebase. Then, in my navigation drawer, I have an activity, called “AccountActivity”, where the user cand see their personal info saved
Adapter doesn’t show product image and price from Firebase Realtime Database
I am trying to retrieve data (a product image and the price for it) from Firebase Realtime Database and put it in a recyclerView, but I have some difficulties. In my database I stored the image url for one product and I want to show that image in an ImageView component placed in the cardView. I also managed to retrieve
Failed to convert a value of type java.lang.String to int?
I am trying to display the total expenses in a Text view but the application keeps giving me this error. The application uses Firebase and I had the getAmount() and setAmount() initiated as String since I only needed to display. It works as Strings but the amount doesn’t get added to himself it just goes in front of the first
how can one display the sum of a group of numbers from firebase in a texview
Im working with android firebase and have managed to get the sum of a group of values from firebase and display it in logcat. Only i want to display this sum in a TextView, how would I do that? Here is my code Answer You’ll need to set the value to the text view in onDataChange, pretty much in the
How do I log out of my Google Account in Firebase such when I log in again, I can choose the account I would like to sign in with?
This is my coding in my java class file where my log out button is located at. How do I log out of my Google Account in Firebase in android studio, such that when I log in again, I am allowed to …
How can i delete firebase child node with the same name?Get the key to be delited from one node and delete those node with same key from the other
I want to delete all the child nodes form different nodes with the same names. I used the following code to get the keys of the child nodes to be deleted and pass it to the other node but it is deleting them from both nodes(completedSurveys and surveyList). Attached below is the firebase realtime database structure. Answer It could be
Updating Firebase Authentication password using user.reauthenticate
To update a user’s password in Firebase Authentication you must re-authenticate : https://firebase.google.com/docs/reference/android/com/google/firebase/auth/FirebaseUser#reauthenticate(com.google.firebase.auth.AuthCredential) Yet this function does not seem to double check if the currentPassword is correct before actually re-authenticating. I believe this may be because Firebase does not require re-authentication until after a set period of time, and will bypass this if it is still within that timeframe. Here’s