I experimented with ActivityManager.killBackgroundProcesses in my application and noticed something interesting. I hope someone from stackoverflow can shed some light on this.
So, if I launch an application, for example, youtube, I first see a list of video pages, then I click menu-> Settings, I get a settings page. Now, if I press the Home button, which puts youtube in the background. So far, so good. Now, if I run ActivityManager.killBackgroundProcesses to kill the youtube application (or I use the Advanced task killer, which I believe uses the same API), and when I launch youtube again, I see the settings page, not a list of videos by by default.
But if instead of doing ActivityManager.killBackgroundProcesses, I go to system settings → I control the application-> Youtube-> Force stop, and when I launch youtube again, I get a list of video pages, not a settings page.
So, it looks like ActivityManager.killBackgroundProcesses is different from stopping a forced stop, as it still remembers the last task / page it was on before it was placed in the background, while stopping an effort gives you a new start.
Does anyone have a good explanation? Is it possible to make a "forced stop" in my code to start a new application launch?
Many thanks!
source share