Firebase ServerValue.TIMESTAMP in Java data models objects

前端 未结 6 1340
[愿得一人]
[愿得一人] 2020-11-30 10:42

I\'m new to Firebase, and I\'ve been really enjoying it so far. I\'m running into a problem; I\'m using the FirebaseListAdapter similar to the tutorial outline here: https:

6条回答
  •  萌比男神i
    2020-11-30 11:05

    Here's how I do it

    //member variable
    Object createdTimestamp;
    
    public YourConstructor(){
        createdTimestamp = ServerValue.TIMESTAMP
    }
    
    @Exclude
    public long getCreatedTimestampLong(){
        return (long)createdTimestamp;
    }
    

提交回复
热议问题