In the actual application development, we may carry on the network interaction in the Onresume, in the network interaction process inevitably uses the ProgressDialog, then now the question comes, When we pop up a progress dialog box, if our activity's OnPause life method is executed, then when the data is loaded and the dialog disappears, the activity's onresume is executed again, and then the network is requested again. Such a vicious circle began, such a mistake is too serious, of course, the above is only in my imagination, and then the code to experiment with, in the Pop up a dialog box when our activity's onpause is not executed, so it will not cause onresume repeated execution,
When we create the dialog box, we need to pass in a parameter of the context type. This parameter also shows that our dialog is created in this context, our activity is interacting, and does not perform OnPause
Android in activity pops up a dialog box that does not perform the OnPause life cycle method