Hello Alfonso,
Thanks for replying back to my query . As suggested by you i was looking at the oncancelled () method of the addValueEventListner.
But to my surprise it is not getting called at all after i delete the user from console .I know i can force user to sign out if their is error in read / write of database to solve my login issue.
I kindly request you to see if i am doing something wrong.
//Copying the code of default security rule
{
"rules": {
".read": "auth != null",
".write": "auth != null"
}
}
// code snipped from my MainActivty.java
// Read from the database
DatabaseReference myRef = database.getReference("test");
myRef.addValueEventListener(new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot dataSnapshot) {
// This method is called once with the initial value and again
// whenever data at this location is updated.
String value = dataSnapshot.getValue(String.class);
Toast.makeText(mContext,"Value is: " + value,Toast.LENGTH_LONG).show();
}
@Override
public void onCancelled(DatabaseError error) {
// Failed to read value
Toast.makeText(mContext,"Failed to read value :"+ error.toException(),Toast.LENGTH_LONG).show();
}
});
Dheeraj Marda