
760
Rozdział 18.
Kod usługi DelayedMessageService
package com.hfad.wic;
import android.app.IntentService;
import android.content.Intent;
import android.util.Log;
import android.support.v4.app.NotificationCompat;
import android.app.PendingIntent;
import android.app.NotificationManager;
public class DelayedMessageService extends IntentService {
public static final String EXTRA_MESSAGE = ”message”;
public static final int NOTIFICATION_ID = 5453;
public DelayedMessageService() {
super(”DelayedMessageService”);
}
@Override
protected void onHandleIntent(Intent intent) {
synchronized (this) {
try {
wait(10000);
} catch (InterruptedException e) {
e.printStackTrace(); ...