Logout from Twitter using twitter4j library

2019-06-14 13:59发布

问题:

I have integrated twitter into an android application. I have problem in logging out user of twitter account. I have looked at almost all question on SO about it.

All says that twitter does not provide logout function. Few of them states that we can display login page each time using force_login=true.

Using twitter4j library I never call twitter URL. Most probably twitter4j handles it. So my question is that how to pass parameter force_login using twitter4j library? Is there any way to ask twitter4j library to pass parameters I want?

回答1:

For using Twitter4J this link may help you I suppose.

Happy Coding..



回答2:

mTwitter.setOAuthAccessToken(null);
mTwitter.shutdown();  //removed from latest version

This works,try, source: http://wenchaokong.blogspot.in/2013/03/android-twitter-integration-twitter4j.html