In our application, we are embeding a webview inside an activity and
removing all
cookies. In the android devlopers console crash report , we are
getting following exception for the users and we are not able to reporduce
this issue.
We are not able to figure out the issue. Attaching the code below.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
this.getWindow().requestFeature(Window.FEATURE_PROGRESS);
String url = generateOpenIdUrl();
webview = new WebView(Webview.this);
setContentView(webview);
WebSettings WebSettings = webview.getSettings();
WebSettings.setJavaScriptEnabled(true);
webview.setWebChromeClient(new WebChromeClient() {
public void onProgressChanged(WebView view, int progress)
{
activity.setTitle("Loading...");
activity.setProgress(progress * 100);
if(progress == 100)
activity.setTitle("Login with social networks");
}
});
webview.setWebViewClient(new HelloWebViewClient(Webview.this));
CookieSyncManager.createInstance(MySocialNetworks.this);
android.webkit.CookieManager.getInstance().removeAllCookie();
webview.loadUrl(url);
}
Exception getting for the users.
java.lang.IllegalStateException: CookieSyncManager::createInstance() needs
to be called before CookieSyncManager::getInstance()
at android.webkit.CookieSyncManager.getInstance(CookieSyncManager.java:81)
at android.webkit.CookieManager$2.run(CookieManager.java:532)
at java.lang.Thread.run(Thread.java:1019)
--
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