I am downloading data from firebase realtime in my application. We download this data on the splashscreen. The splashscreen screen should not turn off before this data is downloaded. Couldn't find how to do this
This my code;
mDatabase.child("/server/Time").addListenerForSingleValueEvent(new ValueEventListener() {
@Override
public void onDataChange(@NonNull DataSnapshot dataSnapshot) {
long time = dataSnapshot.getValue(Long.class);
MyApplication.getInstance().setmServer(new server(time));
}
@Override
public void onCancelled(@NonNull DatabaseError databaseError) {
hideProgressDialog();
}
});