What happen if showDialog of activity get called ? Does activity call onPause if yes why ? As it is the part of Activity only then why onPause gets call?
Asked
Active
Viewed 682 times
2
-
ShowDialog means any AlertDialog from your activity? – user370305 Dec 19 '11 at 10:48
-
you can try for yourself: Override the onPause and onResume method and include a System.out.println("paused") or something similar there. As far as I remember (and that's why i'm posting this as a comment not an answer) it's just the focus you loose, but it does not pause. – stefan Dec 19 '11 at 11:10
-
Are you just curious? Or do you have an actual problem? If you're just curious, try it out, like @stefan told. Otherwise, tell us what's the question is – Entreco Dec 19 '11 at 23:33
1 Answers
1
onPause() isn't called on activity that showed dialog.
onPause() is called when your activity is no longer at the top of the activity stack. A Dialog by itself is not an Activity, so will not replace the current Activity at the top of the stack, so will not cause anything to pause.
A dialog (lower-case) does not need to be implemented by a Dialog class, however. For example it is not uncommon to implement one with an Activity whose theme is set to that of a dialog. In this case displaying the dialog-as-an-Activity will cause the new Activity to be on the top of the stack, pausing what previously was there.

Community
- 1
- 1

congtuyenvip
- 44
- 3