diff --git a/app/src/main/java/gr/thmmy/mthmmy/utils/parsing/NewParseTask.java b/app/src/main/java/gr/thmmy/mthmmy/utils/parsing/NewParseTask.java index ec1da28e..ab6047e8 100644 --- a/app/src/main/java/gr/thmmy/mthmmy/utils/parsing/NewParseTask.java +++ b/app/src/main/java/gr/thmmy/mthmmy/utils/parsing/NewParseTask.java @@ -6,7 +6,7 @@ public abstract class NewParseTask extends AsyncTask { private OnParseTaskStartedListener onParseTaskStartedListener; private OnParseTaskCancelledListener onParseTaskCancelledListener; - private OnParseTaskFinishedListener onParseTaskFinishedListener; + private OnParseTaskFinishedListener onParseTaskFinishedListener; @Override protected void onPreExecute() { @@ -35,37 +35,25 @@ public abstract class NewParseTask extends AsyncTask { @Override protected void onPostExecute(V v) { if (onParseTaskFinishedListener != null) - onParseTaskFinishedListener.onParseFinish(); + onParseTaskFinishedListener.onParseFinish(v); else super.onPostExecute(v); } public NewParseTask(OnParseTaskStartedListener onParseTaskStartedListener, OnParseTaskCancelledListener onParseTaskCancelledListener, - OnParseTaskFinishedListener onParseTaskFinishedListener) { + OnParseTaskFinishedListener onParseTaskFinishedListener) { this.onParseTaskStartedListener = onParseTaskStartedListener; this.onParseTaskCancelledListener = onParseTaskCancelledListener; this.onParseTaskFinishedListener = onParseTaskFinishedListener; } - public NewParseTask(OnParseTaskStartedListener onParseTaskStartedListener, OnParseTaskFinishedListener onParseTaskFinishedListener) { + public NewParseTask(OnParseTaskStartedListener onParseTaskStartedListener, OnParseTaskFinishedListener onParseTaskFinishedListener) { this.onParseTaskStartedListener = onParseTaskStartedListener; this.onParseTaskFinishedListener = onParseTaskFinishedListener; } public NewParseTask() { } - public void setOnParseTaskStartedListener(OnParseTaskStartedListener onParseTaskStartedListener) { - this.onParseTaskStartedListener = onParseTaskStartedListener; - } - - public void setOnParseTaskCancelledListener(OnParseTaskCancelledListener onParseTaskCancelledListener) { - this.onParseTaskCancelledListener = onParseTaskCancelledListener; - } - - public void setOnParseTaskFinishedListener(OnParseTaskFinishedListener onParseTaskFinishedListener) { - this.onParseTaskFinishedListener = onParseTaskFinishedListener; - } - public interface OnParseTaskStartedListener { void onParseStart(); } @@ -74,7 +62,7 @@ public abstract class NewParseTask extends AsyncTask { void onParseCancel(); } - public interface OnParseTaskFinishedListener { - void onParseFinish(); + public interface OnParseTaskFinishedListener { + void onParseFinish(V result); } }