tags:

views:

14

answers:

0

I have to get my followers list, I used following code,I didn't get my list can anyone please point out my mistake public void onClick(View v) { try { AccessToken accessToken2 = new AccessToken(test, test1); Twitter twitter = new TwitterFactory().getOAuthAuthorizedInstance(CONSUMER_KEY,CONSUMER_SECRET,accessToken2); PagableResponseList follower = twitter.getFriendsStatuses(followers); List list = new ArrayList(); Log.e(TAG,"Iteration 1"); Log.e(TAG,"Number Of Followers : "+ follower.size()); list.addAll(follower);

            long nextCursor = follower.getNextCursor();
            Log.e(TAG, "NextCursor :"+ nextCursor);
            Log.e(TAG,"Iteration 2");
            PagableResponseList<User> followernew = twitter.getFriendsStatuses(test2,follower.getNextCursor());
            Log.e(TAG,"New Followers : "+ followernew.size());
            list.addAll(followernew);

            Log.e(TAG,"Iteration 3");
            followernew = twitter.getFriendsStatuses(test2, follower.getNextCursor());
            Log.e(TAG,"New Followers Phase1 :"+ followernew.size());
            list.addAll(followernew);

            Log.e(TAG,"Iteration 4");
            followernew = twitter.getFriendsStatuses(test2, follower.getNextCursor());
            Log.e(TAG,"New Followers phase2 :"+ followernew.size());
            list.addAll(followernew);

            Log.e(TAG,"Total Number:"+ list.size());
            for(User user: list){
                Log.e(TAG,user.getScreenName());
            }

        } catch (TwitterException e) {

            e.printStackTrace();
        }
   }
});