--- a/app/src/main/java/com/codesys/forge/MainActivity.java +++ b/app/src/main/java/com/codesys/forge/MainActivity.java @@ -146,13 +146,20 @@ } - + protected void PassCookiesToService() { + String urlString = "https://forge.codesys.com/rest/forge/saml"; + String cookies = CookieManager.getInstance().getCookie(urlString); + Intent serviceIntent = new Intent(myContext, MyService.class); + serviceIntent.putExtra("cookies", cookies); + startService(serviceIntent); + } protected void loadUrl(String Url, String Title) { refreshLayout.setRefreshing(true); currentURL = Url; myWebView.loadUrl(Url); RemoveNotification(); + PassCookiesToService(); } private boolean getNetworkState() {