I'm using Firebase in android studio, and I want to make a signup and login project. I'm able to save data to the Firebase, but I can't retrieve data.
In every example, it's realtime --like, we set up a listener first and save data-- but mine is just storing and later retrieving.
Is there a way to just retrieve data? (I wish you could understand :( )
public void onLogIn(View v){ reference2 = fbData.getReference(loginId.getText().toString()); reference2.addListenerForSingleValueEvent(new ValueEventListener() { @Override public void onDataChange(DataSnapshot dataSnapshot) { String gotPw = dataSnapshot.getValue(String.class); if(gotPw == loginPw.getText().toString()){ Log.d("TEST","DONE"); } } @Override public void onCancelled(DatabaseError databaseError) { Log.d("TEST","ERROR"); } }); } This code doesn't even call the onDataChange method.
onDataChange()nor youronCancelled()is being called, it's most likely that your not connected to the network.