[android-developers] Re: Child activity lifetime in background
HI, Use this tag in the manifest for the activities so that it will not get killed after any amount of time... android:alwaysRetainTaskState=true * * *njoy programming* *:) * On Wednesday, September 15, 2010 12:10:26 PM UTC+5:30, viktor wrote: Hi, I have next problem, I have got parent activity and few sub- activities, if app goes to the background by pressed HOME button for long time, all children will be killed, and my app restart from parent activity. For example: A1 - parent, A2,A3,A4 - sub-activities. A1--A2-- A3(top), from A3 I go to the background (HOME). wait 30-40 min and restart app. Only A1 displayed. Could you please explain how to resolve my problem? Thanks -- 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 android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: Child activity lifetime in background
very good thought but isn't this why you should be saving your state and starting off as if you were resuming? from a user's perspective it is the right expectation and from the os perspective this is the right implementation. On Wed, Sep 15, 2010 at 10:17 AM, viktor victor.scherb...@gmail.com wrote: If you haven't used an app this long, it's reasonable to expect it to be killed and started from scratch next time you open it. Why is this a problem? My app based on maps and blogs, many of users said that isn't convenient when they hide an app, and restating it to startup activity. They want that app coming to the same activity. For example, you are reading blog, and meet your friend somewhere, you will hide your app. After few minutes you want to come to your blog, but blog closed. -- 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 android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- 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 android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Child activity lifetime in background
If you haven't used an app this long, it's reasonable to expect it to be killed and started from scratch next time you open it. Why is this a problem? My app based on maps and blogs, many of users said that isn't convenient when they hide an app, and restating it to startup activity. They want that app coming to the same activity. For example, you are reading blog, and meet your friend somewhere, you will hide your app. After few minutes you want to come to your blog, but blog closed. -- 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 android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: Child activity lifetime in background
On Wed, Sep 15, 2010 at 9:17 AM, viktor victor.scherb...@gmail.com wrote: They want that app coming to the same activity. Either play with Activity launch flags (I doubt there's something that will do this, but worth a shot) or track the user's last activity and state yourself in the preferences and then restore it as necessary when your main activity is restarted. - TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago transit tracking app for Android-powered devices -- 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 android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: Child activity lifetime in background
15.09.2010 18:24, TreKing ?: On Wed, Sep 15, 2010 at 9:17 AM, viktor victor.scherb...@gmail.com mailto:victor.scherb...@gmail.com wrote: They want that app coming to the same activity. Either play with Activity launch flags (I doubt there's something that will do this, but worth a shot) or track the user's last activity and state yourself in the preferences and then restore it as necessary when your main activity is restarted. I believe it's this one: http://developer.android.com/reference/android/content/Intent.html#FLAG_ACTIVITY_NEW_TASK -- Kostya Vasilyev -- WiFi Manager + pretty widget -- http://kmansoft.wordpress.com -- 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 android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Child activity lifetime in background
Have you tried adding alwaysRetainTaskState to your Activity declaration? http://developer.android.com/guide/topics/manifest/activity-element.html#always When this attribute is 'true', users will always return to the task in its last state, regardless of how they get there. On Sep 14, 11:40 pm, viktor victor.scherb...@gmail.com wrote: Hi, I have next problem, I have got parent activity and few sub- activities, if app goes to the background by pressed HOME button for long time, all children will be killed, and my app restart from parent activity. For example: A1 - parent, A2,A3,A4 - sub-activities. A1--A2--A3(top), from A3 I go to the background (HOME). wait 30-40 min and restart app. Only A1 displayed. Could you please explain how to resolve my problem? Thanks -- 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 android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en