简体   繁体   English

如何在 android 应用程序上从 twitter 注销

[英]How to Log out from twitter on an android app

Here is the code that I am using to remove data that twitter uses to log me in so as to create a log out button.这是我用来删除 twitter 用来让我登录以创建注销按钮的数据的代码。 But it still logging me automatically.但它仍然自动记录我。 Any ideas?有任何想法吗?

SharedPreferences.Editor editor = (this.getSharedPreferences(Login.PREFERENCES,
Context.MODE_PRIVATE)).edit();
    editor.remove(Login.userkey);
    editor.remove(Login.usersecret);
    editor.remove(Login.username);
    editor.commit();
    finish();

I have implement the twitter using the http://www.londatiga.net/it/how-to-post-twitter-status-from-android/ .我已经使用http://www.londatiga.net/it/how-to-post-twitter-status-from-android/实现了 twitter。 so i can logout using the所以我可以使用注销

 public void logoutTwitter() {
        mTwitter.resetAccessToken();
    }

Please check the code on the site and also check the GitHub.请检查网站上的代码并检查 GitHub。

I hope this will help you.我希望这能帮到您。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM