I have integrated Twitter
into my application (using OAuth
and twitter4j
library) to update status on user's account on behalf of user. This works nice.
Before updating status, I check in Shared Preferences
for stored AccessToken
. If it is available, i.e. user is logged in, then update the status otherwise user is not logged in and hence display twitter page for user to login.
The problem is that if user has once logged in and hence I have AccessToken
in Shared Preferences
and now, if user revokes permission from application and I try to post status, then it gives this exception or error.
How do I come to know that user has revoked permission and thus I need to ask for authorization?
EDIT : I come to know how to handle the case of unuthorized access and I handled it. But still this exception is thrown.