/** General AsyncTask */
private static abstract class MALUAPITask<Result> extends AsyncTask<Void, Void, Result> {
/** The handler for the retrieved data */
protected final ConnectionHandler handler;
protected final String url;
public MALUAPITask(ConnectionHandler handler, String url) {
this.handler = handler;
this.url = url;
}
@Override
protected Result doInBackground(Void... params) {
String result = getResponseString(url);
if(result != null && ! isCancelled()){
return doInBackground(result);
}
return null;
}
/** Called when doInBackground has gotten the wanted data from the Connection */
protected abstract Result doInBackground(String results);
}