我用了
Twitter.getSessionManager().clearActiveSession();
这不起作用,下次我使用Twitter登录时,它将打开浏览器对话框,使用以前的登录名,只是询问“是否允许应用程序提取您的数据?”,但不要求提供用户名和密码。赞赏。
我终于找到了解决这种情况的方法。
偶然,我在适用于Android的Twitter SDK套件中找到了一种方法
CookieSyncManager.createInstance(this);
CookieManager cookieManager = CookieManager.getInstance();
cookieManager.removeSessionCookie();
Twitter.getSessionManager().clearActiveSession();
Twitter.logOut();
这很简单,我花了大约半个小时才找到它。
对于3.0及更高版本
CookieSyncManager.createInstance(this);
CookieManager cookieManager = CookieManager.getInstance();
cookieManager.removeSessionCookie();
TwitterCore.getInstance().getSessionManager().clearActiveSession()
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句