Possible Duplicate:
WebView and Cookies on Android
I'm creating android app for taking surveys. The survey opens in WebView and it has multiple pages. To be able to proceede to the next page there have to be Cookies enabled or you are redirected back to the welcome page.
So my question is how can I enable Cookies in WebView? There are a few and all of them have to be accepted to proceede with survey.
Here's a bit of code that I have (nothing about cookies yet):
public class SurveyViewer extends Activity {
private WebView surveyWebView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.survey_view);
surveyWebView = (WebView) findViewById(R.id.surveywebview);
surveyWebView.getSettings().setJavaScriptEnabled(true);
surveyWebView.loadUrl("http://test.1ka.si/a/797");
surveyWebView.setWebViewClient(new WebViewClient() {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
view.loadUrl(url);
return true;
}
});
}
}
EDIT: How can I check which Cookies were saved if any?