From bb7537f65ac15289c9a1e709d20a88324d6d01fe Mon Sep 17 00:00:00 2001 From: Thodoris1999 Date: Mon, 10 Sep 2018 23:32:27 +0300 Subject: [PATCH] fixes --- .../mthmmy/utils/parsing/NewParseTask.java | 24 +++++-------------- 1 file changed, 6 insertions(+), 18 deletions(-) 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); } }