IllegalStateException:在使用此类之前调用​​CookieSyncManager :: createInstance()或创建webview

时间:2013-03-13 06:30:35

标签: android cookiemanager

当我致电CookieManager.getInstance().getCookie(url)

时,我正在 ISE
I/dalvikvm( 1022): java.lang.IllegalStateException: Call CookieSyncManager::createInstance() or create a webview before using this class
I/dalvikvm( 1022):     at android.webkit.JniUtil.checkInitialized(JniUtil.java:45)
I/dalvikvm( 1022):     at android.webkit.JniUtil.getDatabaseDirectory(JniUtil.java:66)
I/dalvikvm( 1022):     at android.webkit.CookieManager.nativeGetCookie(Native Method)
I/dalvikvm( 1022):     at android.webkit.CookieManager.getCookie(CookieManager.java:496)
I/dalvikvm( 1022):     at android.webkit.CookieManager.getCookie(CookieManager.java:460)

有人可以指出我为什么会这样,以及如何解决它?

提前多多感谢!

0 个答案:

没有答案