A very basic backstory here, I am creating an attendance monitoring app for my final year project. This class opens when a student scans a generated QR Code. When they hit yes, I want it to add +1 to their Present value. However, I'm having some issues with this, since this code I'm using here:
rootRef.child("Users").child(uid).child("present").setValue(+1);
It changes the child node Present in the Database to an Integer type, which causes a crash in the Profile.class because it's trying to display it as a String, that is what I want.
How do I convert this value back to a string once it's been updated to reflect the student's attendance?
-Edit--------
Thanks for the quick response, how would I then go about changing everything to make it an int. This is my User.java which creates the variable fields for the Database:
package com.example.finalyearproject;
public class User {
//Initializing all of the variable names and values for the Database to upload to and pull from.
public String name, email, year, course, role, absences, present;
public User() {
}
public User(String name, String email, String year, String course, String role, String absences, String present) {
//These will be used to upload and pull data to and from the database, mainly for the Profile.class
this.name = name;
this.email = email;
this.year = year;
this.course = course;
this.role = role;
this.absences = absences;
this.present = present;
}
}