Webview cannot accept cookies

前端 未结 5 1749
醉话见心
醉话见心 2020-12-10 12:43

I\'m creating a WebView based Android app that enables the user to login onto a mobile operator. When I run the app the WebView opens the website but I get a message that th

5条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-10 13:21

    @Darko.

    CookieManager.getInstance() is the CookieManager instance for your entire application. Hence, you enable or disable cookies for all the webviews in your application.

    Normally it should work if your webview is already initialized: http://developer.android.com/reference/android/webkit/CookieManager.html#getInstance()

    Maybe you call CookieManager.getInstance().setAcceptCookie(true); before you initialize your webview.

    Thanks,

提交回复
热议问题