Issue
i have an android app with a webView to open some youtube links but i have a problem that every time the app close and reopen i need to login again i read some questions here but didn't got an answer this is my code.
webView = findViewById(R.id.webView);
String url = "https://www.youtube.com/watch?v="+vidInfo[vidNum][2];
WebSettings webSettings = webView.getSettings();
webSettings.setJavaScriptEnabled(true);
webSettings.setDomStorageEnabled(true);
webSettings.setAppCachePath(getCacheDir().getPath());
webSettings.setAppCacheEnabled(true);
webSettings.setMediaPlaybackRequiresUserGesture(true);
webView.setWebViewClient(new WebViewClient());
webView.loadUrl(url);
Solution
your session data is saved in cookies. you therefore need to make them persistent between sessions checkout this answer
Answered By - denniz crypto
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.