everyone, I was trying to make a music app, and for this, I Created a Horizontal RecyclerView
in my HomeFragment
and my horizontal RecyclerView
The problem in your code lies in the fact that the names of the fields in your TestUploads
class are different than the name of the properties in your database. You have in your TestUploads
class a field named songName
but in your database, I see it as SongName
and this is not correct. The names must match. When you are using a getter named getSongName()
, Firebase is looking in the database for a field named songName
and not SongName
. See the lowercase s
letter vs. capital letter S
?
There are two ways in which you can solve this problem. The first one would be to remove the data in your database and add it again using field names that start with lowercase, as exist in your TestUploads
class.
If you are not allowed to use the first solution, then the second approach will be to use annotations
. So you should use the PropertyName annotation in front of the getters. So in your TestUploads
class, a getter should look like this:
@PropertyName("SongName")
public String getSongName() {
return songName;
}