summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Oeh <daniel@danielpc.(none)>2012-04-19 19:18:05 +0200
committerDaniel Oeh <daniel@danielpc.(none)>2012-04-19 19:18:05 +0200
commit4b5160c30c87972026e65876ee3a5707895f0c19 (patch)
treed98540fbaf1936671edfbae4501cc7b7cb21c42d
parent38141354f6199ee02f08d5720baf48fd50cc5a9d (diff)
downloadAntennaPod-4b5160c30c87972026e65876ee3a5707895f0c19.zip
Added Logging messages
-rw-r--r--res/values/strings.xml1
-rw-r--r--src/de/podfetcher/activity/AddFeedActivity.java2
-rw-r--r--src/de/podfetcher/storage/DownloadRequester.java13
3 files changed, 11 insertions, 5 deletions
diff --git a/res/values/strings.xml b/res/values/strings.xml
index ba495bcad..eef0f2a54 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -24,6 +24,7 @@
<string name="download_successful">Download successful</string>
<string name="download_failed">Download failed</string>
<string name="download_pending">Download pending</string>
+ <string name="download_running">Download running</string>
</resources>
diff --git a/src/de/podfetcher/activity/AddFeedActivity.java b/src/de/podfetcher/activity/AddFeedActivity.java
index c1e5f5f14..273cabf2e 100644
--- a/src/de/podfetcher/activity/AddFeedActivity.java
+++ b/src/de/podfetcher/activity/AddFeedActivity.java
@@ -5,6 +5,7 @@ import android.widget.Button;
import android.widget.EditText;
import android.view.View;
import android.app.ProgressDialog;
+import android.util.Log;
import de.podfetcher.R;
import de.podfetcher.feed.Feed;
import de.podfetcher.storage.DownloadRequester;
@@ -78,6 +79,7 @@ public class AddFeedActivity extends SherlockActivity {
dialog.dismiss();
finish();
}else {
+ Log.d(TAG, "Changing message of dialog.");
dialog.setMessage(AddFeedActivity.this.getString(observer.getResult()));
}
return null;
diff --git a/src/de/podfetcher/storage/DownloadRequester.java b/src/de/podfetcher/storage/DownloadRequester.java
index e346ccdad..d18d442fe 100644
--- a/src/de/podfetcher/storage/DownloadRequester.java
+++ b/src/de/podfetcher/storage/DownloadRequester.java
@@ -198,7 +198,7 @@ public class DownloadRequester {
break;
case DownloadManager.STATUS_RUNNING:
Log.d(TAG, "Download is running.");
- result = getDownloadStatus(cursor, DownloadManager.COLUMN_BYTES_DOWNLOADED_SO_FAR);
+ result = R.string.download_running;
break;
case DownloadManager.STATUS_FAILED:
Log.d(TAG, "Download failed.");
@@ -210,11 +210,12 @@ public class DownloadRequester {
Log.d(TAG, "Download pending.");
result = R.string.download_pending;
break;
-
+
}
try {
- client.call();
+ client.call();
}catch (Exception e) {
+ Log.e(TAG, "Error happened when calling client: " + e.getMessage());
}
if(done) {
@@ -222,12 +223,14 @@ public class DownloadRequester {
} else {
try {
sleep(waiting_intervall);
- }catch (InterruptedException e) {}
+ }catch (InterruptedException e) {
+ Log.w(TAG, "Thread was interrupted while waiting.");
+ }
}
}
Log.d(TAG, "Thread stopped.");
}
-
+
public void setClient(Callable callable) {
this.client = callable;
}