I am a newbie, trying to execute 2 url queries on the same activity in Android. I managed to get it done using two different AsyncTasks running in parallel.
Both url queries have separate classes and query classes - its two different websites with different data. However i wanted to display it on one screen - one activity.
I initiated both my Loaders with separate loaderIDs
private static final int LOCAL_LOADER_ID = 1;
private static final int GLOBAL_LOADER_ID = 2;
Then i initiated both the loaders . . . .
LoaderManager loaderManager = getLoaderManager();
loaderManager.initLoader(LOCAL_LOADER_ID, null, new LocalLoaderClass());
loaderManager.initLoader(GLOBAL_LOADER_ID, null, new GlobalLoaderClass());
and created the LoaderCallbacks for both of them, so this is an example of the first one one, the second one is the same:
private class GlobalLoaderClass implements
LoaderManager.LoaderCallbacks<GlobalData>
{
@Override
public Loader<GlobalData> onCreateLoader(int i, Bundle bundle) {
return new GlobalDataLoader(this, CMC_REQUEST_URL);
}
and so on . . . . . . with the remaining Override methods
However i keep getting an error on the method, i think i am missing something. I have implemented the GlobalDataClass(Context, URL)