Added Logging messages

This commit is contained in:
Daniel Oeh 2012-04-19 19:18:05 +02:00
parent 38141354f6
commit 4b5160c30c
3 changed files with 11 additions and 5 deletions

View File

@ -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>

View File

@ -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;

View File

@ -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;
}