Skip to content Skip to sidebar Skip to footer

Signout Using Twitter4j Is Not Working With Android

I am using twitter 4j 3.0.2 jar I have integrate twitter in my android app.I have successfully login and send tweet to twitter account but I face issue in logout from twitter acco

Solution 1:

You need to use force login in twitter. For more details see my previous post

Twitter Login Dialog error

So you just need to add force_login=true in your authorize url i.e

http://twitter.com/oauth/authorize?force_login=true

Solution 2:

The simplest way is to clear the cookies.

Write the following one line code in your onCreate of the webview class.

android.webkit.CookieManager.getInstance().removeAllCookie();

Hope it helps.

Above code will remove all your cookie(like twitter,facebook and any other)

To signout from twitter you need to set the twitter oauth cookie to null.

CookieManager.getInstance().setCookie(".twitter.com", "auth_token=''");

Solution 3:

I solved issue just changing Call back url from oauth://t4jsample to... public static final String TWITTER_CALLBACK_URL = "api.twitter.com/oauth/authorize?force_login=true";

Post a Comment for "Signout Using Twitter4j Is Not Working With Android"