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 account from my android app.
I implement this as same as twitter4j sample app and I have noticed that same issue also in twitter4j sample app.
Steps I have done
My main issue is that how to signout from twitter from android app.Is twitter cache is maintained in anywhere in device ? if yes then how I clear twitter cache from my android app.
Editor e = mSharedPreferences.edit();
e.remove(PREF_KEY_OAUTH_TOKEN);
e.remove(PREF_KEY_OAUTH_SECRET);
e.remove(PREF_KEY_TWITTER_LOGIN);
e.commit();
//twitter.shutdown();
twitter = new TwitterFactory().getInstance();
twitter.setOAuthConsumer(TWITTER_CONSUMER_KEY,TWITTER_CONSUMER_SECRET);
You need to use force login in twitter. For more details see my previous post
So you just need to add force_login=true in your authorize url i.e
http://twitter.com/oauth/authorize?force_login=true