I am pretty sure the browser saves its state in onSaveInstanceState, not
persistently, and this is currently as intended.  That is, it will retain
its state when its process gets killed and restarted, but it is deliberately
not trying to retain its state across reboots.

Note that instance state is always saved before pause, BEFORE an app goes to
the background.  So that is the key point for state saving; after that, it
doesn't matter when the process gets killed, nor is there a need to let the
app do anything before it gets killed, the activity manager already has its
saved state so it can be used to restore the activity in a new process.

There are two main ways the browser could be losing its state:

(1) The activity itself gets finished.  Most likely the browser isn't doing
this, but others can cause it to happen -- such as by hitting the "Force
Stop" button which (prior to Froyo) is the API that task managers have been
abusing.

(2) Just a big in the browser (or less likely in the activity manager) that
is causing the state to be lost or not correctly restored.

To investigate these, you can use "adb shell dumpsys activity" to see the
activity stack (in particular the browser activity entry) at various points.
 When it is in the background, does it say it has the saved state?  Right
before restarting it, is the entry still there will the saved state?  If so,
then there is most likely something going on when the browser tries to
restore its state.  If not, then something earlier is going buggy when the
state is saved.

On Sat, Jun 5, 2010 at 12:25 PM, Frank Weiss <[email protected]> wrote:

> The state save I'm refering to is via SharedPreferences. I've observed
> this in my own application. Indeed, the Android Browser's bookmarks are
> saved across reboots, and I'd suppose across force closes as well, However,
> I think Mark is correct that some state may not be correctly saved in a FC
> situation.
>
> I think my theory still stands that the browser is not saving windows
> across reboots and FCs. If you think about it, it may not even be possible,
> depending on how you define saving windows, although FF and IE are able to
> restore tabs.
>
> --
> 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]<android-developers%[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

Reply via email to