Skip to content

Commit

Permalink
Revert.
Browse files Browse the repository at this point in the history
  • Loading branch information
yanchenko committed Oct 18, 2012
1 parent 932653f commit d607e74
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
11 changes: 2 additions & 9 deletions base/src/org/droidparts/task/AsyncTask.java
Expand Up @@ -26,7 +26,6 @@ public abstract class AsyncTask<Params, Progress, Result> extends
android.os.AsyncTask<Params, Progress, Pair<Exception, Result>> {

protected final Context ctx;
protected final String tag;
protected final AsyncTaskProgressListener progressListener;
protected final AsyncTaskResultListener<Result> resultListener;

Expand All @@ -36,16 +35,10 @@ public AsyncTask(Context ctx) {

public AsyncTask(Context ctx, AsyncTaskProgressListener progressListener,
AsyncTaskResultListener<Result> resultListener) {
this(ctx, progressListener, resultListener, null);
}

public AsyncTask(Context ctx, AsyncTaskProgressListener progressListener,
AsyncTaskResultListener<Result> resultListener, String tag) {
Injector.get().inject(ctx, this);
this.ctx = ctx;
this.progressListener = progressListener;
this.resultListener = resultListener;
this.tag = (tag == null) ? getClass().getName() : tag;
}

@Override
Expand Down Expand Up @@ -91,13 +84,13 @@ public abstract Result executeInBackground(Params... params)

protected void onSuccessPostExecute(Result result) {
if (resultListener != null) {
resultListener.onSuccess(tag, result);
resultListener.onAsyncTaskSuccess(result);
}
}

protected void onFailurePostExecute(Exception exception) {
if (resultListener != null) {
resultListener.onFailure(tag, exception);
resultListener.onAsyncTaskFailure(exception);
}
}

Expand Down
Expand Up @@ -15,11 +15,10 @@
*/
package org.droidparts.task.listener;


public interface AsyncTaskResultListener<Result> {

void onSuccess(String taskTag, Result result);
void onAsyncTaskSuccess(Result result);

void onFailure(String taskTag, Exception e);
void onAsyncTaskFailure(Exception e);

}

0 comments on commit d607e74

Please sign in to comment.