package org.mtransit.android.commons.task;

import org.mtransit.android.commons.Constants;
import org.mtransit.android.commons.MTLog;

import android.app.LoaderManager;
import android.app.LoaderManager.LoaderCallbacks;
import android.content.Loader;
import android.os.Bundle;

public abstract class MTLoaderManagerLoaderCallbacks<D> implements LoaderManager.LoaderCallbacks<D>, MTLog.Loggable {

	@Override
	public Loader<D> onCreateLoader(int id, Bundle args) {
		if (Constants.LOG_TASK_LIFECYCLE) {
			MTLog.v(this, "onCreateLoader(%s,%s)", id, args);
		}
		return onCreateLoaderMT(id, args);
	}

	/**
	 * @see LoaderCallbacks#onCreateLoader(int, Bundle)
	 */
	public abstract Loader<D> onCreateLoaderMT(int id, Bundle args);

	@Override
	public void onLoaderReset(Loader<D> loader) {
		if (Constants.LOG_TASK_LIFECYCLE) {
			MTLog.v(this, "onLoaderReset(%s)", loader);
		}
		onLoaderResetMT(loader);
	}

	/**
	 * @see LoaderCallbacks#onLoaderReset(Loader)
	 */
	public abstract void onLoaderResetMT(Loader<D> loader);

	@Override
	public void onLoadFinished(Loader<D> loader, D data) {
		if (Constants.LOG_TASK_LIFECYCLE) {
			MTLog.v(this, "onLoadFinished(%s,%s)", loader, data);
		}
		onLoadFinishedMT(loader, data);
	}

	/**
	 * @see LoaderCallbacks#onLoadFinished(Loader, Object)
	 */
	public abstract void onLoadFinishedMT(Loader<D> loader, D data);
}

@@ -147,132 +147,147 @@
 oid.
-app.LoaderManager;%0Aimport android.app.LoaderManager.LoaderCallbacks;%0Aimport android.content.Loader;%0Aimport android.os.Bundle
+os.Bundle;%0Aimport android.support.annotation.NonNull;%0Aimport android.support.v4.app.LoaderManager;%0Aimport android.support.v4.content.Loader
 ;%0A%0Ap
@@ -404,16 +404,26 @@
 able %7B%0A%0A
+%09@NonNull%0A
 %09@Overri
@@ -623,32 +623,46 @@
 %0A%0A%09/**%0A%09 * @see 
+LoaderManager.
 LoaderCallbacks#
@@ -795,24 +795,33 @@
 LoaderReset(
+@NonNull 
 Loader%3CD%3E lo
@@ -954,32 +954,46 @@
 %0A%0A%09/**%0A%09 * @see 
+LoaderManager.
 LoaderCallbacks#
@@ -1112,24 +1112,33 @@
 oadFinished(
+@NonNull 
 Loader%3CD%3E lo
@@ -1287,32 +1287,32 @@
 data);%0A%09%7D%0A%0A%09/**%0A
-
 %09 * @see LoaderC
@@ -1300,24 +1300,38 @@
 **%0A%09 * @see 
+LoaderManager.
 LoaderCallba

Update Support Libraries (v27.1.0)