I have a dialog appearing on back press, but when it is show, I want the activity to be set on pause, there is animations playing, countdown timers working, etc.
Is there a simple way to put the whole activity on pause, without the need to pause each animation/timer, etc?
@Override
public void onBackPressed() {
AlertDialog.Builder builder = new AlertDialog.Builder(BreathActivity.this);
ViewGroup viewGroup = findViewById(android.R.id.content);
View dialogView = LayoutInflater.from(BreathActivity.this).inflate(R.layout.dialog_signin, viewGroup, false);
builder.setView(dialogView);
AlertDialog alertDialog = builder.create();
alertDialog.show();
}
Thanks!