Yeah I'm still having this issue, can anyone help? any ideas? Here is my new updated code:
String server = settings.getString("server", ""); String user = settings.getString("username", ""); String passwd = settings.getString("passwd", ""); webview = new WebView(this); WebSettings webSettings = webview.getSettings(); webSettings.setJavaScriptEnabled(true); webview.setWebViewClient(new InsideWebViewClient()); setContentView(webview); String credUrl = "http://"+server+"/services.php?sname=LoginService&isapp=true&username="+user+"&rawpassword="+passwd; //CookieSyncManager.createInstance(webview.getContext()); //CookieSyncManager.getInstance(); CookieManager cookieManager = CookieManager.getInstance(); cookieManager.setAcceptCookie(true); webview.loadUrl(credUrl); String rawCookie = cookieManager.getCookie(server); mes(rawCookie); /*while(rawCookie == null){ SystemClock.sleep(1000); rawCookie = cookieManager.getCookie(credUrl); }*/ webview.loadUrl("http://"+server); basically i just took out the cookie sync manager because it wasnt really doing anything and put a while loop in "that is now commented out" that was crashing the app :/ On Friday, March 23, 2012 4:05:41 PM UTC-5, emada.adame wrote: > > I have an app that is trying to log into a site and get the cookie then > show me the cookie in a toast but most of the time it fails to get the > cookie, is there some timeout issue here or something im hitting? > > here is my code > > public void showPage(){ > try{ > String server = settings.getString("server", ""); > String user = settings.getString("username", ""); > String passwd = settings.getString("passwd", ""); > WebView webview = new WebView(this); > WebSettings webSettings = webview.getSettings(); > webSettings.setJavaScriptEnabled(true); > setContentView(webview); > String credUrl = > "http://"+server+"/services.php?sname=LoginService&username="+user+"&rawpassword="+passwd; > CookieSyncManager syncMgr = > CookieSyncManager.createInstance(webview.getContext()); > CookieSyncManager.getInstance(); > CookieManager cookieManager = CookieManager.getInstance(); > String rawCookie = cookieManager.getCookie(credUrl); > mes(rawCookie); > }catch(Exception e){ > mes("err3: "+e.toString()); > } > } > -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en