Twitter Login issue : twitter4j and singpost lib

73 Views Asked by At

HI I am trying to login threw signpost library in my android app, it is working good but while login sometimes the web dialog does not update login status. it keeps me showing the enter username and password field.

when I cancel the dialog and try it again it is showing logged in user.

1

There are 1 best solutions below

0
Maveňツ On

TwitterOAuthView is a WebView subclass dedicated to Twitter OAuth on Android, using twitter4j.

Twitter OAuth View for Android using twitter4j
http://darutk-oboegaki.blogspot.jp/2012/07/twitter-oauth-view-for-android-using.html

Since it is implemented as a subclass of View, it can be integrated into the Android layout system seamlessly. This fact makes TwitterOAuthView an easily-reusable UI component.

Its usage is very simple. Just call start() method

// Start Twitter OAuth process. Getting a request token, opening Twitter's
// authorization page, and getting an access token are performed.
view.start(CONSUMER_KEY, CONSUMER_SECRET, CALLBACK_URL, true, listener);

and receive its result via TwitterOAuthView.Listener interface.

// Definition of TwitterOAuthView.Listener interface.
void onSuccess(TwitterOAuthView view, AccessToken accessToken);
void onFailure(TwitterOAuthView view, TwitterOAuthView.Result result);

An example of Activity implementation using TwitterOAuthView can be found at GitHub TwitterOAuthView.