android - One getter returns null, the others return the acctual value firebase -


i've got pretty strange problem firebase database, or class, 1 of getters doesn't work headline implies.

this "customprotocolother" class:

public class customprotocolother implements parcelable {     public string pileid;     public string dimhead;       public customprotocolother() {     }  public customprotocolother(string pileid,                             string dimhead,       ) {          this.pileid = pileid;         this.dimhead = dimhead;      }      protected customprotocolother(parcel in) {          pileid = in.readstring();         dimhead = in.readstring();       }      public static final creator<customprotocolother> creator = new creator<customprotocolother>() {         @override         public customprotocolother createfromparcel(parcel in) {             return new customprotocolother(in);         }          @override         public customprotocolother[] newarray(int size) {             return new customprotocolother[size];         }     };      public void setpileid(string pileid) {         this.pileid = pileid;     }      public string getpileid() {         return pileid;     }      public void setdimhead(string dimhead) {         this.dimhead = dimhead;     }      public string getdimhead() {         return dimhead;     }   @override     public int describecontents() {         return 0;     }      @override     public void writetoparcel(parcel parcel, int i) {         parcel.writestring(pileid);         parcel.writestring(dimhead);      } } 

in activty i'm trying both dimhead , pileid this:

private void populateothertextviews() {         mprotocoldatabasereferenceother = mprotocoldatabasereference.child(pileid).child(other); // 7901337/1/_other          mprotocoldatabasereferenceother.addvalueeventlistener(new valueeventlistener() {             @override             public void ondatachange(datasnapshot datasnapshot) {                  string s = protocolother.getpileid();                  string p = protocolother.getdimhead();                } } 

but latter 1 returns null, cant seem figure out why getdimhead doesnt work? have missed?

when run program debug finds there value in dimhead's node, getter returns null. attached snippet of firebase database.

update: protocolother instantiated in oncreate intent:

 intent intent = getintent();         existing_protocol = intent.getbooleanextra("exitingprotocol", false);         protocolother = intent.getparcelableextra("protocolothers");         protocolamount = intent.getparcelableextra("protocolamounts"); 

firebase data


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -