Okay I'm trying to get webview working so that when user presses button from application it would go to login page with username+password in POST. This works almost correctly but cookies don't work which screws part of the page's operation. Here's the code:
What am I missing? Works fine if I use reqular browser to log in and then go to application and press the button so I know it SHOULD be doable but guess I'm missing step(or two) here.
Code:
String postData = "u="+username+"&p="+passwd;
WebView webview=(WebView)findViewById(R.id.myWebView);
CookieManager cookieManager = CookieManager.getInstance();
CookieSyncManager.createInstance(this);
CookieSyncManager.getInstance().startSync();
cookieManager.setAcceptCookie(true);
webview.getSettings().setJavaScriptEnabled(true);
webview.postUrl(website, EncodingUtils.getBytes(postData, "BASE64"));
What am I missing? Works fine if I use reqular browser to log in and then go to application and press the button so I know it SHOULD be doable but guess I'm missing step(or two) here.
