How to save users score in firebase and retrieve it in real-time in Android studio

前端 未结 3 473
日久生厌
日久生厌 2020-11-22 10:12

I am creating an app in which points increases on button click and those points should be saved to firebase. I managed to save those data to firebase. But when I destroy my

3条回答
  •  谎友^
    谎友^ (楼主)
    2020-11-22 10:52

    I think that previous score is a string in you code @DHANANJAY KUMAR and Strings cannot be added and also what is the meaning of String.class. I think It can be made

    int previousScore = dataSnapshot.getValue(Integer.class);
    

    if we can edit

    String.class
    

    to

    Integer.class
    

    or

    int.class
    

    Please Clarify

提交回复
热议问题