Code example for AsyncTaskLoader

Methods: onStartLoading

0
	@Override 
	protected void onStartLoading() { 
		 
		Log.d(TAG, "onStartLoading()");
 
		super.onStartLoading(); 
		 
		//get model 
		Model model = Model.getInstance();
		//get movies from model 
		List<ITunesMovie> movies = model.getMovies();
		 
		//if movie list is empty 
		if (0 == movies.size()) {
			Log.d(TAG, "No movie found in model, downloading top list from iTunes...");
			//start downloading movie list from iTunes 
			forceLoad();
		} else { 
			Log.d(TAG, "Delivering movies...");
			//deliver movies to adapter 
Experience pair programming with AI  Get Codota for Java