I was experimenting with ActivityManager.killBackgroundProcesses in my application and notice something interesting. I hope someone on stackoverflow can shed some light on this.
So if I start an application, for example, youtube, I first see the list of video page, then I click menu->Settings, I will get the settings page. now if I click home button, which will put youtube to background. so far so good. Now if I run ActivityManager.killBackgroundProcesses to kill youtube application (or I use Advanced task killer which I believe using the same API), and when I launch youtube again, I see the setting page, not the default list of video page.
But if instead of doing ActivityManager.killBackgroundProcesses, I go to system settings->manage application->Youtube->Force stop, and when I launch youtube again, I get the list of video page, not the setting page.
So it seems that ActivityManager.killBackgroundProcesses is different from force stop as it still remembers the last task/page it was on before it was put to background, whereas force stop gives you a fresh start.
Anyone has good explanation for it? Is it possible in my code to do "force stop" to get a fresh start of the application?
Many thanks!