Yes, sorry.
I did it in my code, but not when I wrote it here!
On Jan 14, 7:05 pm, Mohammed Le Doze mohammed.led...@googlemail.com
wrote:
You are welcome. It sure will be useful for somebody.
Just a quick note about your getCookie method: make sure to store the size
of the 'cookies' list
You are welcome. It sure will be useful for somebody.
Just a quick note about your getCookie method: make sure to store the size
of the 'cookies' list before the for loop. Not doing so forces the JVM to
calculate the size of the list on each iteration.
More info here:
Thank you Mohammed, but I've already seen these questions !
I win ! I don't use onSaveInstanceState/onRestoreInstanceState because
I save the cookie in SharedPreferences when I receipt it , and restore
it if I have to create a new HttpClient. So my code :
private static final String COOKIE_NAME =
I am afraid you have to implement a recovery mechanism in any case,
because of cookies expiration. If the server gives you an
authentication error you should restart the authentication process
before performing any other action.
In any case you can serialize and store the cookie in the shared
First of all, thanks a lot for your answer Federico!
My server seems to always accept the same cookie, I'm not sure, but
for now, we can guess it !
So I think I'll try to serialize store the cookie before the
activity is killed, and restore it when restart.
I'll send a message after this work is
5 matches
Mail list logo