Using sessionStorage in a webview

by hansamann » Wed, 16 Jun 2010 04:55:02 GMT

Sponsored Links
 Hi all,

I am trying to set a flag for the current session in the webview. I
enabled the DOM storage API:


In my HTML page, loaded from the assets directory, I then execute a
small piece of javascript like this:

                        if (!sessionStorage.flag)
                                        //do stuff once per session
                                        sessionStorage.flag = true;
                                //do nothing

Problem: the //do stuff once per session section is always entered, it
seems the flag is set but each orientation change reloads the complete
HTML page and all the session state is completely lost.

I wanted to use the flag to execute a piece of code once, and even if
the user turns the device, (in which the HTML page seems to be
reloaded, for whatever reason), not execute the code again.

Any ideas?
Is this just broken becaus I load the HMTL resource from the local
package, from the assets directory?



Other Threads

1. why do I get null pointer with findWiewById ?

Because you cannot use findViewById(R.layout.main). findViewById()
uses values. You need to associate an android:id with any widget
you expect to load via findViewById(), and use the equivalent of
that ID value.

Mark Murphy


2. How to override methods for existing framework classes

Certainly not the *Manager classes. If you look at the source code for
those, you will notice that they tend to be clients for remote
services exporting AIDL interfaces.

Mark Murphy


3. SQLite db limitations for Android app

4. why do I get null pointer with findWiewById ?

5. How to override methods for existing framework classes

6. connectionless WAP Push (SMS Push)

7. How global is the app market?