I am working on twitter, I have access token and I am also getting the tweets now I want to reply on that tweets like we did in Twitter website for this I am using the below code but it's not reply to the tweet but it updates my status please help me to solve this issue Thanks..
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
}
}