What are you actually trying to do?  I doubt this parameter is what
you want -- it is used to defeat the default behavior of resetting an
application's task state after the device has been asleep for a
certain amount of time.  That is, it will have -no- impact on the
behavior of your application unless you put the emulator to sleep for
that amount of time (I believe 30 minutes) and then launch it from
home.

If you are -always- returning back the initial screen of your app when
returning from home, that indicates some other problem in how you have
structure your app.  This might be useful information to help
understand what is going on: http://code.google.com/android/intro/appmodel.html

Some common things to watch out for:

- Don't use android:singleTask (unless you understand what that is and
really actually do want everything it implies).
- Don't use Intent.FLAG_ACTIVITY_NEW_TASK (unless you understand what
that is and really actually do want everything it implies).

The above referenced doc has information on these as well.

On Aug 22, 6:05 am, code_android_festival_way
<[EMAIL PROTECTED]> wrote:
> I came across the parameter "alwaysRetainTaskState" 
> athttp://code.google.com/android/reference/android/R.attr.html#alwaysRe...
> and don't really know how to use it the right way. I've got several
> activities in my application and want to persist the state of my
> activity UI so that the user can press the home button and after
> starting my application again he will come back to the last opened
> activity.
> When I understand the parameter in the right way I think that he
> should do what I want. Now I've added the parameter to all activities
> in my AndroidManifest but after restarting my application from the
> home screen (after pressing the home button in my app) I'm always
> getting back to my initial screen.
>
> Here is one sample from my AndroidManifest:
>
>         <activity android:name=".Preferences"
>                           android:alwaysRetainTaskState="true">
>         </activity>
>
> What am I doing wrong? In addition I'd like to ask what state in
> detail will be presisted. (the complete UI state?)
>
> Regards!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to