Please help me how activity life cycle behave at the time of phone ringing until receive the call
Asked
Active
Viewed 738 times
1 Answers
2
Activity: onPause
, onStop
, onSaveInstanceState
.
If Android has lack of memory, also onDestroy
will be called.
Fragments: onPause
, onStop
, onSaveInstanceState
. If lack of memory, also onDestroyView
, onDestroy
.
About onSaveInstanceState
see When exactly are onSaveInstanceState() and onRestoreInstanceState() called?.

CoolMind
- 26,736
- 15
- 188
- 224
-
No my question is that what activity life cycle fire at the time of phone ringing until the phone is receive. – Dipan Das Sep 30 '19 at 09:27
-
I know after receive call it goes to onPause state of activity life cycle. – Dipan Das Sep 30 '19 at 09:30
-
1@DipanDas, when a phone is ringing, it is similar to appearing a new application. You will see another (phone) activity above yours. So, your activity will be stopped and becomes hidden. I also added information about `onSaveInstanceState`. – CoolMind Sep 30 '19 at 09:48
-
But in my application i checked that when a call come to my phone when an activity is already open in my device then the call popup appear on the top of the screen and no activity life cycle was call until I receive the call. – Dipan Das Sep 30 '19 at 10:13
-
@DipanDas, it is interesting. Can you show your device model, OS version and post a screenshot to the question? – CoolMind Sep 30 '19 at 10:15
-
I attach the screenshot of my application where I tried to play a video in video view and when phone call comes its pause automatically. But in that case I put the pause code in activity onPause but it working when the call was receive. – Dipan Das Sep 30 '19 at 10:35
-
@DipanDas, when `onPause` occurs? After you tap on green tube? Then I suppose your activity lifecycle is intact until you receive a phone call. I think, when you tap red tube, it also won't call `onPause`. And what is Android version number? – CoolMind Sep 30 '19 at 10:42
-
-
@DipanDas, see also settings: https://www.guidingtech.com/fix-incoming-call-not-showing-screen/. – CoolMind Sep 30 '19 at 12:58