android – 如何使用Twitter4j api在推文上回复?

我在twitter上工作,我有访问令牌,我现在也收到推文我想在推特上回复,就像我们在Twitter网站上做的那样我使用下面的代码,但它不是回复推文但它更新我的状态请帮我解决这个问题谢谢..
public void tweetReply() {
    try {
        // System.out.println("Post Id= " + itemsObj.postId);
        Accesstoken a = new Accesstoken(twittertokens[0],twittertokens[1]);
        Twitter twitter = new TwitterFactory().getInstance();

        twitter = new TwitterFactory().getInstance();
        twitter.setoAuthConsumer(Constants.CONSUMER_KEY,Constants.CONSUMER_SECRET);
        twitter.setoAuthAccesstoken(a);
        Long id = new Long("236178766597087234");
        twitter.updateStatus(new StatusUpdate("@lalitrajput024  this is to test For reply option ").inReplyToStatusId(id));

    } catch (Exception e) {
        // Todo: handle exception
    }
}

解决方法

我也遇到了这个问题,然后我尝试在文本中使用处理程序.现在它似乎正在工作.
public static void reply(long inReplyToStatusId,String text,double latitude,double longitude,TwitterFactory factory) throws TwitterException
{   Accesstoken accesstoken = loadAccesstoken();
    Twitter twitter = factory.getInstance();
    twitter.setoAuthConsumer(consumerKey,consumerSecrate);
    twitter.setoAuthAccesstoken(accesstoken);


    StatusUpdate stat= new StatusUpdate(text);

    stat.setInReplyToStatusId(inReplyToStatusId);


    GeoLocation location= new GeoLocation(latitude,longitude);
    stat.setLocation(location);

    twitter.updateStatus(stat);
 }'

我称之为

reply(238912922250792960l,"@praveena_kd testing reply",12.787,77.7578,factory);

相关文章

Android性能优化——之控件的优化 前面讲了图像的优化,接下...
前言 上一篇已经讲了如何实现textView中粗字体效果,里面主要...
最近项目重构,涉及到了数据库和文件下载,发现GreenDao这个...
WebView加载页面的两种方式 一、加载网络页面 加载网络页面,...
给APP全局设置字体主要分为两个方面来介绍 一、给原生界面设...
前言 最近UI大牛出了一版新的效果图,按照IOS的效果做的,页...