@OnClick(R.id.logout_btn) public void logoutBtnClicked() { final WebView webView = (WebView) this.findViewById(R.id.webView); WebViewController.getInstance() .logout(); // don't know why this doesn't work, when logout from appmainpage CookieManager.getInstance().removeAllCookie(); // TODO don't know , why this works only here. }
@OnClick(R.id.login_btn_2) public void loginBtnClicked_2() { final WebView webView = (WebView) this.findViewById(R.id.webView); // final ProgressBar progressBar = (ProgressBar) this.findViewById(R.id.progressBar); // https://mnscorp.sharepoint.com/sites/MSW/SiteAssets/MSW-SiteLogo.png // https://mnscorp.sharepoint.com/Style%20Library/mands/images/logo.png String spHome = "https://mnscorp.sharepoint.com/Pages/Home.aspx"; String simpleSPImageUrl = "https://mnscorp.sharepoint.com/sites/MSW/SiteAssets/MSW-SiteLogo.png"; // this request // login, but // doesn't create // cookie. String simpleSPPageUrl = "https://mnscorp.sharepoint.com/sites/MSW/Lists/Site%20Links/DispForm.aspx"; String simpleSPHtmlUrl = "https://mnscorp.sharepoint.com/sites/MSW/home"; String url = simpleSPHtmlUrl; String cookieRoot = "mnscorp.sharepoint.com"; String cookie = CookieManager.getInstance().getCookie(cookieRoot); Log.i("xxxxxx", "cookie = " + cookie); if (cookie != null) { // logged in before, already loggedin . // however, the user account may expired. showTheRealApp(); } else { webView.setVisibility(View.VISIBLE); webView.setTag("web"); WebViewController.getInstance() .initWebView( webView, url, new ICallback() { @Override public void success() { webView.setVisibility(View.GONE); showTheRealApp(); } @Override public void failure(String message) {} }); } }