Android: wait for firebase valueEventListener
问题 I am trying to use Semaphore to wait for my firebase valueEventListener. I have an user info activity with 6 different fields that the user must fill out. When the user saves his/her info, I want to do an "all or nothing" type of check. Certain user info cannot be duplicated...for example user name, email, and phonenumber. I am using firebase and currently the general idea is of the format: void saveUserInfo(){ if(field1 exist in database){ return; } . . . if(field6 exist in database){ return