diff options
author | Scott Jackson <daneren2005@gmail.com> | 2013-09-09 21:06:57 -0700 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2013-09-09 21:06:57 -0700 |
commit | 42f2e42fb4482928883768d1d1a600a1c8d45191 (patch) | |
tree | 5f35926cff894fa7778146d2d848409057dfc143 /src/github | |
parent | 3b16539fafbbf406d9a3c8b7fc447e5cf5f727f3 (diff) | |
download | dsub-42f2e42fb4482928883768d1d1a600a1c8d45191.tar.gz dsub-42f2e42fb4482928883768d1d1a600a1c8d45191.tar.bz2 dsub-42f2e42fb4482928883768d1d1a600a1c8d45191.zip |
Fix errors from web commit
Diffstat (limited to 'src/github')
-rw-r--r-- | src/github/daneren2005/dsub/util/Util.java | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/github/daneren2005/dsub/util/Util.java b/src/github/daneren2005/dsub/util/Util.java index 78c14f4d..e9e58452 100644 --- a/src/github/daneren2005/dsub/util/Util.java +++ b/src/github/daneren2005/dsub/util/Util.java @@ -60,6 +60,7 @@ import github.daneren2005.dsub.domain.RepeatMode; import github.daneren2005.dsub.domain.Version; import github.daneren2005.dsub.provider.DSubWidgetProvider; import github.daneren2005.dsub.receiver.MediaButtonIntentReceiver; +import github.daneren2005.dsub.service.DownloadFile; import github.daneren2005.dsub.service.DownloadService; import github.daneren2005.dsub.service.DownloadServiceImpl; import org.apache.http.HttpEntity; @@ -932,10 +933,10 @@ public final class Util { DSubWidgetProvider.notifyInstances(context, downloadService, false); } - public static void showDownloadingNotification(final Context context, DownloadFile file, int size, Handler handler) { - NotificationCompat.Builder notification; - notification = new NotificationCompta.Builder(context) - .setSmallIcon(R.downloading) + public static void showDownloadingNotification(final Context context, final DownloadServiceImpl downloadService, DownloadFile file, int size, Handler handler) { + NotificationCompat.Builder builder; + builder = new NotificationCompat.Builder(context) + .setSmallIcon(R.drawable.downloading) .setContentTitle("Downloading " + size + " songs") .setContentText("Current: " + file.getSong().getTitle()) .setProgress(10, 5, true); @@ -944,16 +945,18 @@ public final class Util { notificationIntent.putExtra(Constants.INTENT_EXTRA_NAME_DOWNLOAD, true); notificationIntent.putExtra(Constants.INTENT_EXTRA_NAME_DOWNLOAD_VIEW, true); notificationIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP); - notification.setContentIntent(PendingIntent.getActivity(context, 0, notificationIntent, 0)); + builder.setContentIntent(PendingIntent.getActivity(context, 0, notificationIntent, 0)); + + final Notification notification = builder.build(); handler.post(new Runnable() { @Override public void run() { - downloadService.startForeground(Constants.NOTIFICATION_ID_DOWNLOADING, notification.build()); + downloadService.startForeground(Constants.NOTIFICATION_ID_DOWNLOADING, notification); } }); } - public static void hideDownloadingNotification(final Context context, Handler handler) { + public static void hideDownloadingNotification(final Context context, final DownloadServiceImpl downloadService, Handler handler) { // Remove notification and remove the service from the foreground handler.post(new Runnable() { @Override |