我正在尝试将 Twitter 集成到 Android 中,我已按照以下链接中的教程进行操作http://www.androidhive.info/2012/09/android-twitter-oauth-connect-tutorial/ http://www.androidhive.info/2012/09/android-twitter-oauth-connect-tutorial/
但我在这些行中遇到了 loginwithTwitter 函数的异常
ConfigurationBuilder builder = new ConfigurationBuilder();
builder.setOAuthConsumerKey(TWITTER_CONSUMER_KEY);
builder.setOAuthConsumerSecret(TWITTER_CONSUMER_SECRET);
Configuration configuration = builder.build();
TwitterFactory factory = new TwitterFactory(configuration);
twitter = factory.getInstance();
try {
requestToken = twitter.getOAuthRequestToken(TWITTER_CALLBACK_URL);
this.startActivity(new Intent(Intent.ACTION_VIEW,
Uri.parse(requestToken.getAuthenticationURL())));
} catch (TwitterException e) {
e.printStackTrace();
Toast.makeText(getApplicationContext(), e.getMessage(), Toast.LENGTH_SHORT).show();
}
我得到 e.getMessage() 为 null 并且此行发生异常
requestToken = twitter.getOAuthRequestToken(TWITTER_CALLBACK_URL);
请帮我解决这个问题。我还在互联网上搜索过,并在 stackoverflow 上搜索过类似的其他查询,例如Android 推特登录无法使用 https://stackoverflow.com/questions/15807111/android-twitter-login-not-working
and Android 中的 Twitter 登录身份验证? https://stackoverflow.com/questions/3268020/twitter-login-authentication-in-android请帮助我,我正在使用 twitter4j-4.0.1
我也遇到了同样的问题。我参考了这个教程,它有效 -http://hintdesk.com/how-to-tweet-in-twitter-within-android-client/comment-page-1/ http://hintdesk.com/how-to-tweet-in-twitter-within-android-client/comment-page-1/
他们还更新到了 twitter4j-core-4.0.1
源代码可以在这里找到 -https://bitbucket.org/hintdesk/android-how-to-tweet-in-twitter-within-android-client https://bitbucket.org/hintdesk/android-how-to-tweet-in-twitter-within-android-client
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)