user1861240 user1861240 - 1 year ago 125
Android Question

How to clear logon credentials from WebView?

I want to clear application data like i can do it from settings. I need to clear login information in WebView when i am login to facebook or twitter, because when i log on once for each of the following uses the same data automatically

I try this:

didn't work, login information are still in browser

I try reset app:

Intent i = getBaseContext().getPackageManager()
.getLaunchIntentForPackage( getBaseContext().getPackageName() );


public void onPageStarted(WebView view, String url, Bitmap favicon) {

Log.d("WEBVIEW", "onFinisghed b true");
Map<String, String> noCacheHeaders = new HashMap<String, String>(2);
noCacheHeaders.put("Pragma", "no-cache");
noCacheHeaders.put("Cache-Control", "no-cache");
view.loadUrl(url, noCacheHeaders);
b = false;

Most of the entries refers to the first method which is described in the link, but it does not work in my case, any ideas?

Answer Source

Try clearing the browser cookies, e.g.


CookieManager documentation is here.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download