eclipse - Android WebView doesn't store the cookies -


seems android webview doesn't store cookies, how enable them?

i used code test it:

        webview = (webview) findviewbyid(r.id.webview);         webview.setwebviewclient(new webviewclient());          webview.getsettings().setjavascriptenabled(true);         webview.getsettings().setbuiltinzoomcontrols(true);          webview.loadurl("http://www.w3schools.com/php/showphp.asp?filename=demo_cookie1"); 

after reload (webview.reload()) page see "cookie 'user' set!" after close application , start again see "cookie 'user' not set!". weirdly enough see set when first start app. what's going on here? there delay when cookies stored or missing something?

thanks!

seems there delay indeed cookies have use code:

        webview.setwebviewclient(new webviewclient() {                public void onpagefinished(webview view, string url) {                    cookiesyncmanager.getinstance().sync();                    toast.maketext(getapplicationcontext(), "page loading complete", toast.length_long).show();                }         }); 

now works fine.


Comments

Popular posts from this blog

cakephp - simple blog with croogo -

How to group boxplot outliers in gnuplot -

bash - Performing variable substitution in a string -