package com.example.todocloud.receiver;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

import com.example.todocloud.app.AppController;
import com.example.todocloud.data.Todo;
import com.example.todocloud.service.ReminderService;

public class ReminderSetter extends BroadcastReceiver {

  /**
   * BOOT_COMPLETED-re reagálva meghívja az ReminderService-t, ami élesíti a még aktuális
   * emlékeztetőket.
   */
  @Override
  public void onReceive(Context context, Intent intent) {
    Intent service = new Intent(context, ReminderService.class);
    service.setAction(ReminderService.CREATE);
    context.startService(service);
  }

  public static void createReminderService(Todo todo) {
    Context applicationContext = AppController.getAppContext();
    Intent reminderIntent = new Intent(applicationContext, ReminderService.class);
    reminderIntent.putExtra("todo", todo);
    reminderIntent.setAction(ReminderService.CREATE);
    applicationContext.startService(reminderIntent);
  }

  public static void cancelReminderService(Todo todo) {
    Context applicationContext = AppController.getAppContext();
    Intent reminderIntent = new Intent(applicationContext, ReminderService.class);
    reminderIntent.putExtra("todo", todo);
    reminderIntent.setAction(ReminderService.CANCEL);
    applicationContext.startService(reminderIntent);
  }

}

@@ -346,164 +346,185 @@
 %0A%0A  
-/**%0A   * BOOT_COMPLETED-re reag%C3%A1lva megh%C3%ADvja az ReminderService-t, ami %C3%A9les%C3%ADti a m%C3%A9g aktu%C3%A1lis%0A   * eml%C3%A9keztet%C5%91ket.%0A   */%0A  @Override%0A  public void onReceive
+@Override%0A  public void onReceive(Context context, Intent intent) %7B%0A    createReminderServicesOnBootCompleted(context);%0A  %7D%0A%0A  private void createReminderServicesOnBootCompleted
 (Con
@@ -531,39 +531,24 @@
 text context
-, Intent intent
 ) %7B%0A    Inte
@@ -557,16 +557,22 @@
  service
+Intent
  = new I
@@ -621,16 +621,22 @@
  service
+Intent
 .setActi
@@ -695,16 +695,22 @@
 (service
+Intent
 );%0A  %7D%0A%0A
@@ -836,32 +836,31 @@
 %0A    Intent 
-reminder
+service
 Intent = new
@@ -911,32 +911,31 @@
 class);%0A    
-reminder
+service
 Intent.putEx
@@ -953,32 +953,31 @@
  todo);%0A    
-reminder
+service
 Intent.setAc
@@ -1038,32 +1038,31 @@
 tartService(
-reminder
+service
 Intent);%0A  %7D
@@ -1194,24 +1194,23 @@
  Intent 
-reminder
+service
 Intent =
@@ -1265,32 +1265,31 @@
 class);%0A    
-reminder
+service
 Intent.putEx
@@ -1311,24 +1311,23 @@
 o);%0A    
-reminder
+service
 Intent.s
@@ -1400,16 +1400,15 @@
 ice(
-reminder
+service
 Inte

Simplify ReminderSetter class