private static void failListener(int requestedAction, String message) { switch (requestedAction) { case ACTION_LOGIN: { RefLoginListener.fail("Login failed: " + message); break; } case ACTION_PUBLISH_STATUS: { RefSocialActionListener.fail("Publish status failed: " + message); break; } case ACTION_PUBLISH_STATUS_DIALOG: { RefSocialActionListener.fail("Publish status dialog failed: " + message); break; } case ACTION_PUBLISH_STORY: { RefSocialActionListener.fail("Publish story failed: " + message); break; } case ACTION_PUBLISH_STORY_DIALOG: { RefSocialActionListener.fail("Publish story dialog failed: " + message); break; } case ACTION_UPLOAD_IMAGE: { RefSocialActionListener.fail("Upload Image failed: " + message); break; } case ACTION_GET_FEED: { RefFeedListener.fail("Get feed failed: " + message); break; } case ACTION_GET_CONTACTS: { RefContactsListener.fail("Get contacts failed: " + message); break; } case ACTION_GET_USER_PROFILE: { RefUserProfileListener.fail("Get user profile failed: " + message); break; } default: { SoomlaUtils.LogWarning(TAG, "action unknown fail listener:" + requestedAction); break; } } clearListener(requestedAction); }
/** * Called when the user's timeline has arrived * * @param statuses The user's latest statuses */ @Override public void gotUserTimeline(ResponseList<Status> statuses) { SoomlaUtils.LogDebug(TAG, "getFeed/onComplete"); List<String> feeds = new ArrayList<String>(); for (Status post : statuses) { feeds.add(post.getText()); } boolean hasMore; if (feeds.size() >= PAGE_SIZE) { lastFeedCursor++; hasMore = true; } else { lastFeedCursor = 1; hasMore = false; } RefFeedListener.success(feeds, hasMore); clearListener(ACTION_GET_FEED); }