android - Keep cookie for all the request in my app when using volley -


i using volley in android application , use load images of time, once have download file(not images) use native httpurlconnection instead of volley.

now want both volley , httpurlconnection use same cookie in whole application.

is possible?

you can create own volleyrequest class extends com.android.volley.request. requests in app using class.

to use cookie these requests override getheaders method , can same operation of setting cookie might doing httpurlconnection

@override public map<string, string> getheaders() throws authfailureerror {    hashmap<string, string> headersmap =  new hashmap<string, string>();    headersmap.put("cookie", "cookie_key=cookie_value");    return headersmap; } 

Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -