在twitter4j中访问directmessage时,出现错误显示“无法解析‘3577866941’”作为整数”
我已经设置了从 dev.twitter 获得的 ACCESS_TOKEN、ACCESSTOKEN_SECRET、CONSUMER_KEY、CONSUMER_SECRET 的值,但它在应用程序运行时崩溃。我使用 twitter4j-core-2.1.8-SNAPSHOT.jar 作为库。代码如下所示。
public ResponseList<DirectMessage> dmList=null;
public static AccessToken token = new AccessToken(ACCESS_TOKEN, ACCESSTOKEN_SECRET);
TwitterFactory factory = new TwitterFactory();
twitter = factory.getInstance();
twitter.setOAuthConsumer(CONSUMER_KEY, CONSUMER_SECRET);
twitter.setOAuthAccessToken(token);
try {
dmList = twitter.getDirectMessages(new Paging(1,15));
} catch (TwitterException e) {
e.printStackTrace();
}
谢谢。
I have set the value of ACCESS_TOKEN,ACCESSTOKEN_SECRET,CONSUMER_KEY,CONSUMER_SECRET which I got from dev.twitter but it crashes when the application runs.I use twitter4j-core-2.1.8-SNAPSHOT.jar as library.The code is given bellow.
public ResponseList<DirectMessage> dmList=null;
public static AccessToken token = new AccessToken(ACCESS_TOKEN, ACCESSTOKEN_SECRET);
TwitterFactory factory = new TwitterFactory();
twitter = factory.getInstance();
twitter.setOAuthConsumer(CONSUMER_KEY, CONSUMER_SECRET);
twitter.setOAuthAccessToken(token);
try {
dmList = twitter.getDirectMessages(new Paging(1,15));
} catch (TwitterException e) {
e.printStackTrace();
}
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Twitter userID 和 tweetID 不是 32 位整数。他们最近将其升级到 64 位,也许您的库已经过时了?
Twitter userID and tweetID are not 32 bit integers. They recently upgraded them to 64bit, maybe your library is out of date ?