android - No setter/field for while trying to populate a listview on firebase -


i trying retrieve data firebase , display on listview using firebase-ui. code runs fine nothing displayed on list view. logs:

w/classmapper: no setter/field -knrxddola9nv6qxxvol found on class com.example.sammie.coreteccontacts.sacco

here 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 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 sample of data firebase

knrwng6btkbgjqjvq9qaddclose

description:"test description"

location: "test location"

name: "test name"

there no setter methods in class.

public void setname(string name) {     this.name = name; }  public void setdescription(string description) {     this.description = description; }  public void setlocation(string location) {     this.location = location; } 

but

-knrwng6btkbgjqjvq9qaddclose

this unique key obtained object containing description, location , name.

w/classmapper: no setter/field -knrxddola9nv6qxxvol found on class com.example.sammie.coreteccontacts.sacco

this shows there error database listener's positioning. reading -knrwng6btkbgjqjvq9qaddclose variable sacco class instead of object of it.

please check json file , databasereference. should this:

  • underchilds <----- (on child listener).
    • -knrwng6btkbgjqjvq9qaddclose
    • -knrwnsynuojkbgjqjvq9qaddclos

Comments

Popular posts from this blog

jOOQ update returning clause with Oracle -

java - Warning equals/hashCode on @Data annotation lombok with inheritance -

java - BasicPathUsageException: Cannot join to attribute of basic type -