[Android] Timeline listeners for exception handling

android

#1

Hi,

Is there any way to receive the exceptions when using a Timeline (for example a UserTimeline or SearchTimeline).
I want to be able to show an error message when tweets fail to load.

Also, a success event would be nice, for example to hide a loading indicator.

Thanks.


#2

Hi, you can set a refresh listener on the TweetTimelineListAdapter.

    adapter.refresh(new Callback<TimelineResult<Tweet>>() {
        @Override
        public void success(Result<TimelineResult<Tweet>> result) {
            swipeLayout.setRefreshing(false);
        }

        @Override
        public void failure(TwitterException exception) {
            // Toast or some other action
        }
    });

see: http://docs.fabric.io/android/twitter/show-timelines.html#refresh


#3