Created
February 23, 2017 03:47
-
-
Save JonathanVeg/b2a65684a05ab258c68b9f8b7bb8ea9e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FirebaseDatabase.getInstance().setPersistenceEnabled(true); | |
final FirebaseDatabase database = FirebaseDatabase.getInstance(); | |
final DatabaseReference showWallet = database.getReference("donation").child("show_wallet"); | |
showWallet.addValueEventListener(new ValueEventListener() { | |
@Override | |
public void onDataChange(DataSnapshot dataSnapshot) { | |
Boolean value = dataSnapshot.getValue(Boolean.class); | |
if (value) | |
llAboutDonate.setVisibility(View.VISIBLE); | |
else | |
llAboutDonate.setVisibility(View.GONE); | |
showWallet.keepSynced(true); | |
} | |
@Override | |
public void onCancelled(DatabaseError error) { | |
// Failed to read value | |
Log.w(TAG, "Failed to read value.", error.toException()); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment