summaryrefslogtreecommitdiff
path: root/vdrmanager/src
diff options
context:
space:
mode:
authorlado <herrlado@gmail.com>2011-10-26 13:03:43 +0200
committerlado <herrlado@gmail.com>2011-10-26 13:03:43 +0200
commit391e1a7d83ac28efbb79b997fd577eff16cb6d29 (patch)
tree9dfc7813c67aca660f958a52c50be711f8ad11c1 /vdrmanager/src
parent4bb750c61db94c98cc8b15134c71590b7bb0f17f (diff)
downloadvdr-manager-391e1a7d83ac28efbb79b997fd577eff16cb6d29.tar.gz
vdr-manager-391e1a7d83ac28efbb79b997fd577eff16cb6d29.tar.bz2
refactor
Diffstat (limited to 'vdrmanager/src')
-rw-r--r--vdrmanager/src/de/bjusystems/vdrmanager/utils/svdrp/SvdrpAsyncTask.java13
1 files changed, 8 insertions, 5 deletions
diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/utils/svdrp/SvdrpAsyncTask.java b/vdrmanager/src/de/bjusystems/vdrmanager/utils/svdrp/SvdrpAsyncTask.java
index 7dc0097..fd4c63b 100644
--- a/vdrmanager/src/de/bjusystems/vdrmanager/utils/svdrp/SvdrpAsyncTask.java
+++ b/vdrmanager/src/de/bjusystems/vdrmanager/utils/svdrp/SvdrpAsyncTask.java
@@ -4,6 +4,7 @@ import java.util.ArrayList;
import java.util.List;
import android.os.AsyncTask;
+import android.util.Log;
public class SvdrpAsyncTask<Result, Client extends SvdrpClient<Result>>
extends AsyncTask<Void, Object, Void>
@@ -34,13 +35,13 @@ public class SvdrpAsyncTask<Result, Client extends SvdrpClient<Result>>
try {
client.run();
} catch (final SvdrpException e) {
- publishProgress(null, null, e);
+ publishProgress(e);
}
return null;
}
public void svdrpEvent(final SvdrpEvent event, final Result result) {
- publishProgress(event, result, null);
+ publishProgress(event, result);
}
@SuppressWarnings("unchecked")
@@ -48,14 +49,16 @@ public class SvdrpAsyncTask<Result, Client extends SvdrpClient<Result>>
protected void onProgressUpdate(final Object... values) {
super.onProgressUpdate(values);
- if (values[2] == null) {
+ if (values.length == 2) {
for(final SvdrpAsyncListener<Result> listener : listeners) {
listener.svdrpEvent((SvdrpEvent)values[0], (Result)values[1]);
}
- } else {
+ } else if(values.length == 1) {
for(final SvdrpAsyncListener<Result> listener : listeners) {
- listener.svdrpException((SvdrpException)values[2]);
+ listener.svdrpException((SvdrpException)values[0]);
}
+ } else {
+ Log.w(toString(), "Unknonw count of argument in onProgressUpdate");
}
}
}