I want my code to do as follows:
@Override
public void onClick(View v) {
...
Firebase ref = new Firebase('url')
ref.addListenerForSingleValueEvent(new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot dataSnapshot) {
// if one of the children fullfills a certain condition
// throw a toast
}
}
}
The only problem is that I can't throw a toast because I am not within the context of the function.
How can I work around this?