I tried as per your suggestions but in the response I am getting all the parameters with null value. Following is the extended TwitterApiCllient I am using:
public class MyTwitterApiClient extends TwitterApiClient {
public MyTwitterApiClient(TwitterSession session) {
super(session);
}
public CustomService getCustomService() {
return getService(CustomService.class);
}
}
interface CustomService {
@GET("/1.1/followers/list.json")
void show(@Query("screen_name") String var, @Query("skip_status") Boolean var1, @Query("include_user_entities") Boolean var2, @Query("count") Integer var3, Callback<User> cb);
}
Another doubt I have is that the result is supposed to be an array but the response I am getting is an object and that is why I have only used User and not List of User as argument in Callback. On using List in Callback I get the following exception:
com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 2
Because of this exception I am using only User in Callback.
What might be the reason behind null values in the response ? Am I doing anything wrong ?
Code snippet of how I am calling the function
customService.show("pranjalsahu", true, false, 10, new Callback<User>() {
@Override
public void success(Result<User> result) {
User user = result.data;
System.out.println("test "+user.createdAt);
System.out.println("test "+user.toString());
System.out.println("test "+user.idStr);
System.out.println("test "+user.id);
System.out.println("test "+user.name);
System.out.println("test "+user.friendsCount);
System.out.println("test "+user.location);
System.out.println("test "+user.screenName);
System.out.println("test "+user.verified);
System.out.println("test "+user.statusesCount);
}
@Override
public void failure(TwitterException e) {
e.printStackTrace();
}
});