I have an application that implements the Application
class.
consider the following 2 scenarios:
A) open the application -> press home -> long-press home to see recent apps. -> swipe kill the application. in this case, the Application
class onCreate
function will be called without any interaction.
B)open the application -> press home -> long press on the app -> viw app info -> click on force stop. in this case, the Application
class onCreate
function will NOT be called.
My questions are:
1 - what is the difference between the two scenarios related to the Application
life cycle.
2- Why when I swipe kill the app the Application
onCreate
method gets called?
P.S I already read this question and it doesn't answer my question.
UPDATE:
I noticed that this behavior in scenario A is not the same for all devices. for example, it happens on a Samsung phone but not on a Pixel phone. maybe it's up to the manufacturer?
picture for scenario A:
picture for scenario B:
When you swipe the app, you kill only activity components. If there are any background services, they will continue working.
When you force stop the app from app menu, you switch off all services working background. For example you will not receive push notifications after this action.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With