I have two custom built loaders inherited from AsyncTaskLoader
which I would like to use in my activity. Each of them returns result of different type.
To use my activity for a callback I must implement two interfaces:
implements LoaderCallbacks<GetSyncListDataResult>, LoaderCallbacks<ErrorResult>
However, trying to implement required methods in the same class I end up with duplicate method error and erasure(???) error:
// Methods for the first loader
public Loader<GetSyncListDataResult> onCreateLoader(int ID, Bundle bundle) ...
public void onLoaderReset(Loader<GetSyncListDataResult> loader) ...
public void onLoadFinished(Loader<GetSyncListDataResult> loader, GetSyncListDataResult result) ...
// Methods for the second loader
public Loader<ErrorResult> onCreateLoader(int ID, Bundle bundle) ...
public void onLoaderReset(Loader<ErrorResult> loader) ...
public void onLoadFinished(Loader<ErrorResult> loader, ErrorResult result) ...
Obviously, the methods are clashing and I need an easy way how to resolve this. What would be the proper way of resolving this?