Search code examples
javatwittertwitter4j

How can I follow a twitter user using Twitter4j framework?


I need my Java Twitter application to be able to follow a user in twitter. When I pass it the user ID as a string, the application follow it automatically. I couldn't find the method that can do that in Twitter4j.


Solution

  • No need for id. It will work with username as well.

    mTwitter.createFriendship("dj")