package com.dummies.android.taskreminder;

import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Intent;
import android.util.Log;

public class ReminderService extends WakeReminderIntentService {

    public ReminderService() {
        super("ReminderService");
    }

    @Override
    void doReminderWork(Intent intent) {
        Log.d("ReminderService", "Doing work.");
        Long rowId = intent.getExtras().getLong(ReminderProvider.COLUMN_ROWID);

        NotificationManager mgr = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);

        Intent notificationIntent = new Intent(this, ReminderEditActivity.class);
        notificationIntent.putExtra(ReminderProvider.COLUMN_ROWID, rowId);

        PendingIntent pi = PendingIntent.getActivity(this, 0,
                notificationIntent, PendingIntent.FLAG_ONE_SHOT);

        Notification note = new Notification(
                android.R.drawable.stat_sys_warning,
                getString(R.string.notify_new_task_message),
                System.currentTimeMillis());
        note.setLatestEventInfo(this,
                getString(R.string.notify_new_task_title),
                getString(R.string.notify_new_task_message), pi);
        note.defaults |= Notification.DEFAULT_SOUND;
        note.flags |= Notification.FLAG_AUTO_CANCEL;

        // An issue could occur if user ever enters over 2,147,483,647 tasks.
        // (Max int value).
        // I highly doubt this will ever happen. But is good to note.
        int id = (int) ((long) rowId);
        mgr.notify(id, note);

    }
}

@@ -177,33 +177,8 @@
 ent;
-%0Aimport android.util.Log;
 %0A%0Apu
@@ -380,58 +380,9 @@
     
-Log.d(%22ReminderService%22, %22Doing work.%22);%0A        L
+l
 ong 
@@ -877,17 +877,30 @@
 fication
-(
+.Builder(this)
 %0A       
@@ -912,44 +912,67 @@
     
-android.R.drawable.stat_sys_warning,
+.setContentTitle(getString(R.string.notify_new_task_title))
 %0A   
@@ -976,32 +976,48 @@
                 
+.setContentText(
 getString(R.stri
@@ -1043,17 +1043,17 @@
 message)
-,
+)
 %0A       
@@ -1065,542 +1065,284 @@
     
-System.currentTimeMillis());%0A        note.setLatestEventInfo(this,%0A                getString(R.string.notify_new_task_title),%0A                getString(R.string.notify_new_task_message), pi);%0A        note.defaults %7C= Notification.DEFAULT_SOUND;%0A        note.flags %7C= Notification.FLAG_AUTO_CANCEL;%0A%0A        // An issue could occur if user ever enters over 2,147,483,647 tasks.%0A        // (Max int value).%0A        // I highly doubt this will ever happen. But is good to note.%0A        int id = (int) ((long) rowId);%0A        mgr.notify(i
+.setSmallIcon(android.R.drawable.stat_sys_warning)%0A                .setContentIntent(pi)%0A                .setAutoCancel(true)%0A                .build();%0A%0A        // An issue could occur if user ever enters over 2,147,483,647 (max int value) tasks.%0A        mgr.notify((int) rowI
 d, n

Fix warnings