No setting / field when trying to populate a list on firebase

I am trying to extract data from firebase and display it in my list using firebase-ui. The code works fine, but nothing is displayed in the list view. This is what I get from my magazines:

W / ClassMapper: no setter / field for -KNRXdDOlA9nV6qxXvOl found in class com.example.sammie.coreteccontacts.Sacco

Here is my FirebaselistAdapter

DatabaseReference mDatabaseReference = FirebaseDatabase.getInstance().getReference();
FirebaseListAdapter<Sacco> adapter = new FirebaseListAdapter<Sacco>(getActivity(), Sacco.class, android.R.layout.simple_list_item_1, mDatabaseReference) {
 @Override
protected void populateView(View view, Sacco sacco, int i) {
((TextView)view.findViewById(android.R.id.text1)).setText(Sacco.getName());
}
};
contactList.setAdapter(adapter);

Here is my sacco class:

package com.example.sammie.coreteccontacts;

public class Sacco {

    String description;
    String location;
    static String name;

    public Sacco() {
    }

    public Sacco(String description, String location, String name) {
        this.name = name;
        this.description = description;
        this.location = location;
    }

    public static String getName() {
        return name;
    }

    public String getDescription() {
        return description;
    }

    public String getLocation() {
        return location;
    }
}

Here is sample data from firebase

KNRWnG6BTkbGJQJVq9Qaddclose

description: "test description"

location: "testing place"

name: "test name"

+4
source share
2 answers

setter.

public void setName(String name) {
    this.name = name;
}

public void setDescription(String description) {
    this.description = description;
}

public void setLocation(String location) {
    this.location = location;
}

-KNRWnG6BTkbGJQJVq9Qaddclose

, , , .

W/ClassMapper: / -KNRXdDOlA9nV6qxXvOl, com.example.sammie.coreteccontacts.Sacco

, . -KNRWnG6BTkbGJQJVq9Qaddclose Sacco .

JSON DatabaseReference. , :

  • UnderChilds < ----- (ON CHILD LISTENER).
    • -KNRWnG6BTkbGJQJVq9Qaddclose
    • -KNRWnSYnuojkbGJQJVq9Qaddclos
+6

node: DatabaseReference mDatabaseReference = FirebaseDatabase.getInstance(). GetReference(). Child ( "Your Node Name" );

0

Source: https://habr.com/ru/post/1649052/


All Articles