You should not assume that the app always starts with the same activity. Many developers make this mistake, for instance by initializing global data in the onCreate() method of the "first" activity.
There are several ways to solve your problem depending on the type of your application. - Make sure the data the activity needs is passed through an intent if possible. Android will automatically pass that intent again when the app is restarted. - Use lazy initialization of the data you need, to make sure it's loaded correctly whenever it's first needed. - Initialize data in an overridden Application.onCreate() to make sure it's loaded before any activity is created. Perhaps it can be solved with launchMode singleTask too, but I'm not sure how that works and it's not recommended. On 14 Juli, 16:12, dillipk <[email protected]> wrote: > Thank you for the replies.. > > I understand that, my app no way can listen to any event when , killed > by a task killer. > > But, WHY my app behaves weird when it restarts from that point? As I > mentioned - instead of starting the App gracefully(by starting the > first screen which is a splash screen), it directly go to some other > screen with EMPTY data.. Whole app behaves wired and the data is empty > everywhere. > > Any idea? or any work around to fix this? > > Thanks, > DK > > On Jul 13, 8:07 pm, Dianne Hackborn <[email protected]> wrote: > > > > > > > > > A task killer doesn't do anything more than the platform would when it needs > > to kill your process when it is in the background. You just need to deal > > with this case. > > > On Wed, Jul 13, 2011 at 9:22 AM, dillipk <[email protected]> wrote: > > > Hello, > > > My app have some issues after being killed by Task Killer. > > > > Sequence: - > > > - Run the app > > > - Press HOME key > > > - Kill all the tasks by TaskKiller > > > - Again run the app.. > > > > At this point, instead of starting the App gracefully(by starting the > > > first screen which is a splash screen), it directly go to some other > > > screen with EMPTY data.. Whole app behaves wired and the data is empty > > > everywhere. > > > > Can my app listen to any event, when it is killed by a TaskKiller..? I > > > tried debugging by going to onDestroy(), but it never got fired.. > > > > Any help on this would greatly appreciated.. > > > > Thanks in advance.. > > > > DK > > > > -- > > > You received this message because you are subscribed to the Google > > > Groups "Android Developers" group. > > > To post to this group, send email to [email protected] > > > To unsubscribe from this group, send email to > > > [email protected] > > > For more options, visit this group at > > >http://groups.google.com/group/android-developers?hl=en > > > -- > > Dianne Hackborn > > Android framework engineer > > [email protected] > > > Note: please don't send private questions to me, as I don't have time to > > provide private support, and so won't reply to such e-mails. All such > > questions should be posted on public forums, where I and others can see and > > answer them. -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

