Buggy code:
public class FragmentShowDetails extends AbstractNavigationFragment { private final String BASE_URL_SHOW = "shows//" ; private final String BASE_URL_SCHEDULE = "//schedules" ; private final String BASE_URL_PODCAST = "podcasts" ; private static final String LIMIT = "&limit=" ; private static final String OFFSET = "?offset=" ; private static final String FINISHED = "&finished=false" ; private static final String ORDER = "&order=asc" ; private int offset = 0 ; private static final int limit = 5 ; private View rootView ; private PodcastListView listView ; private ImageView imageView ; private TextView scheduleTextView ; protected List < Podcast > podcasts = new ArrayList < > ( ) ; private Show resultShow ; private List < Schedule > schedules = new ArrayList < > ( ) ; private int scheduleDisplayed = 0 ; private Context context ; private FragmentShowDetails . ShowDataFactory showDataFactory ; private FragmentShowDetails . PodcastDataFactory podcastDataFactory ; private FragmentShowDetails . ScheduleDataFactory scheduleDataFactory ; private boolean requestSent = false ; private boolean thereIsMoreData = true ; private String createURL ( String type ) { } @ Override public void onResume ( ) { } @ Override public void onStop ( ) { } @ Override public void onDestroy ( ) { } @ Override public View onCreateView ( LayoutInflater inflater , ViewGroup container , Bundle savedInstanceState ) { context = getActivity ( ) ; if ( getArguments ( ) . getBoolean ( FROMNAVDRAWER ) ) { showDataFactory = new FragmentShowDetails . ShowDataFactory ( ) ; showDataFactory . setParameters ( context , createURL ( BASE_URL_SHOW ) , SHOW ) ; } else { Bundle b = getArguments ( ) ; resultShow = b . getParcelable ( "show" ) ; } rootView = inflater . inflate ( content_show_details_fragment , container , false ) ; imageView = ( ( ImageView ) ( rootView . findViewById ( content_show_details_fragment_picture ) ) ) ; if ( ( resultShow ) != null ) { Picasso . with ( context ) . load ( resultShow . getImageURL ( ) ) . into ( imageView ) ; scheduleDataFactory = new FragmentShowDetails . ScheduleDataFactory ( ) ; scheduleDataFactory . setParameters ( context , createURL ( BASE_URL_SCHEDULE ) , SCHEDULE ) ; } scheduleTextView = ( ( TextView ) ( rootView . findViewById ( content_show_details_fragment_date ) ) ) ; ImageButton infoButton = ( ( ImageButton ) ( rootView . findViewById ( content_show_details_fragment_info ) ) ) ; infoButton . setOnClickListener ( new View . OnClickListener ( ) { @ Override public void onClick ( View view ) { InfoDialogFragment dial = new InfoDialogFragment ( ) ; Bundle b = new Bundle ( ) ; b . putInt ( "path" , content_show_details_popup ) ; b . putParcelable ( "show" , resultShow ) ; dial . setArguments ( b ) ; dial . show ( getFragmentManager ( ) , "Info" ) ; } } ) ; ImageButton nextButton = ( ( ImageButton ) ( rootView . findViewById ( content_show_details_fragment_next_schedule ) ) ) ; nextButton . setOnClickListener ( new View . OnClickListener ( ) { @ Override public void onClick ( View view ) { <START_BUG> if ( ( scheduleDisplayed ) == ( ( schedules . size ( ) ) - 1 ) ) <END_BUG> scheduleDisplayed = 0 ; else ( scheduleDisplayed ) ++ ; updateSchedulesUI ( ) ; } } ) ; listView = ( ( PodcastListView ) ( rootView . findViewById ( content_show_details_fragment_listView ) ) ) ; listView . setArguments ( podcasts , this ) ; listView . setOnScrollListener ( new AbsListView . OnScrollListener ( ) { @ Override public void onScrollStateChanged ( AbsListView absListView , int i ) { } @ Override public void onScroll ( AbsListView absListView , int firstVisibleItem , int visibleItemCount , int totalItemCount ) { if ( ( ( ( firstVisibleItem + visibleItemCount ) >= totalItemCount ) && ( ! ( requestSent ) ) ) && ( thereIsMoreData ) ) { podcastDataFactory = new FragmentShowDetails . PodcastDataFactory ( ) ; podcastDataFactory . setParameters ( context , createURL ( BASE_URL_PODCAST ) , PODCAST ) ; requestSent = true ; } } } ) ; return rootView ; } private void updateShowUI ( ) { } private void updatePodcastsUI ( ) { } private void updateSchedulesUI ( ) { } private class ShowDataFactory extends DataFactory { @ Override protected void onReceivingData ( ) { } } private class PodcastDataFactory extends DataFactory { @ Override protected void onReceivingData ( ) { } } private class ScheduleDataFactory extends DataFactory { @ Override protected void onReceivingData ( ) { } } }

Fix:
if ( ( scheduleDisplayed ) >= ( ( schedules . size ( ) ) - 1 ) )