private void fetch() { final String title = mActor != null ? mActor.name + " - " : mGenre != null ? mGenre.name + " - " : "" + "Movies"; DataResponse<ArrayList<Movie>> response = new DataResponse<ArrayList<Movie>>() { public void run() { if (value.size() > 0) { setTitle(title + " (" + value.size() + ")"); mList.setAdapter(new MovieAdapter(mActivity, value)); } else { setTitle(title); setNoDataMessage("No movies found.", R.drawable.icon_movie_dark); } } }; showOnLoading(); setTitle(title + "..."); if (mActor != null) { // movies with a certain actor mVideoManager.getMovies(response, mActor, mActivity.getApplicationContext()); } else if (mGenre != null) { // movies of a genre mVideoManager.getMovies(response, mGenre, mActivity.getApplicationContext()); } else { // all movies mVideoManager.getMovies(response, mActivity.getApplicationContext()); } }