What happens to android app when a phone call interrupts the app?

点点圈 提交于 2019-12-07 02:54:37

问题


I am working on an app and in one of my activities I display a progressdialog. I have managed it so that it displays correctly during rotations, and I thought that would handle the case of a phone call too, but when I test it with a phone call the dialog goes away. So what exactly does the phone call do to the application and how is a part of the application lifecycle?


回答1:


onPause and onStop are called, onDestroy may be called but you can't rely on it.




回答2:


Long-press your home button and switch to another application... its basically the same thing. http://developer.android.com/reference/android/app/Activity.html



来源:https://stackoverflow.com/questions/6448380/what-happens-to-android-app-when-a-phone-call-interrupts-the-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!