title: how to sync cookies between android.webkit.CookieManager and java.net.HttpUrlConnection on Android
body: <p>I'm making a progam on Android.
  It has one button and one WebView. If I click the button, It send post message to a web server. (using httpurlconnection)
  The webview load a page from the same server. I want to sync cookies between core and webview. I found the method from core to webview. But, I couln't find a method from webview to core. </p>
  
  <p>I tried these order.</p>
  
  <ol>
  <li>the page of webview is loaded.</li>
  <li>read cookies from webview.</li>
  <li><p>add these cookies to core cookies using HttpCookie.</p>
  
  <p>URI uri = new URI(url);</p>
  
  <p>HttpCookie httpCookie = new HttpCookie(cookie.getKey(), cookie.getValue());</p>
  
  <p>((java.net.CookieManager) CookieHandler.getDefault()).getCookieStore().add(uri, httpCookie);</p></li>
  </ol>
  
  <p>but It doesn't working. what is wrong? please advice me about it.
  Thank you in advance.</p>