I am trying to count all the values ββin a firebase database in Java. But it does not work, I looked through some tutorials for this, but did not find it for Java programmers.
Here is my database:
Language German Message -Jf6ShYy7niHrqg_x4Tc: "Tomorrow is very windy" -Jf9v0xHAxINUUANrORU: "Today is very windy and rainy"
Here is my code, pay attention to the line in which I tried to use the maximum count value:
Firebase f = new Firebase("https://myapp.firebaseio.com/Language/German/Message/"); f.addValueEventListener(new ValueEventListener() { public void onDataChange(DataSnapshot snapshot) { disp_msg = (TextView)findViewById(R.id.display_msg);
This is the error I get from the max function from Collections:
The max (Collection) method in the Collections type is not applicable for arguments (String)
Does anyone know how to solve this problem in Java, thanks in advance.
source share