Maintain session between HttpUrlConnection Calls (Native/Webview)

后端 未结 4 1788
长情又很酷
长情又很酷 2021-02-12 21:01

Let me start with what I desire:

I want to make an app which is part native and part webviews.

Problem - Maintai

4条回答
  •  抹茶落季
    2021-02-12 21:46

    Try to add this two lines anywhere you want. (Maybe if you extend Application class and add them on the onCreate() method would be better)

    CookieManager cookieManager = new CookieManager();
    CookieHandler.setDefault(cookieManager);
    

提交回复
热议问题