2014-10-06 73 views
0

您好,我正在嘗試登錄扔在我的android應用程序的路標庫,它工作正常,但有時登錄有時web對話框不會更新登錄狀態。 它讓我顯示輸入用戶名和密碼字段。Twitter登錄問題:twitter4j和singpost庫文件

當我取消對話框並再次嘗試時,它顯示登錄用戶。

回答

0

TwitterOAuthView是一個WebView子類,專用於使用twitter4j的Android上的Twitter OAuth。

微博的OAuth視圖爲Android使用twitter4j
http://darutk-oboegaki.blogspot.jp/2012/07/twitter-oauth-view-for-android-using.html

由於它是作爲搜索的子類來實現,它可以被無縫地集成到Android的佈局系統。這個事實使得TwitterOAuthView成爲一個易於重用的UI組件。

它的用法很簡單。只需調用start()方法

// 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); 

並通過TwitterOAuthView.Listener接口接收其結果。

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

使用TwitterOAuthView活動實現的示例可以在GitHub TwitterOAuthView找到。