How do I pass this information out of onDataChange
into the same activity all within onCreate
....
mDatabase.addListenerForSingleValueEvent(new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot dataSnapshot) {
String teste = (String) (dataSnapshot.child("texto").getValue());
}
@Override
public void onCancelled(DatabaseError databaseError) {
}
});
Thank you in advance!