content: package com.pomodoro.application.broadcastReceiver;
  
  import android.app.NotificationChannel;
  import android.app.NotificationManager;
  import android.app.PendingIntent;
  import android.app.Service;
  import android.content.Context;
  import android.content.Intent;
  import android.os.IBinder;
  
  import androidx.annotation.Nullable;
  import androidx.core.app.NotificationCompat;
  
  import com.pomodoro.application.R;
  import com.pomodoro.application.activity.MainActivity;
  
  public class AlarmService extends Service {
  
      public AlarmService() {
          super();
      }
  
      @Override
      public int onStartCommand(Intent intent, int flags, int startId) {
          onHandleIntent();
          return super.onStartCommand(intent, flags, startId);
      }
  
      protected void onHandleIntent() {
          NotificationManager mNotificationManager =
                  (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
          if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
              NotificationChannel channel = new NotificationChannel("YOUR_CHANNEL_ID",
                      "YOUR_CHANNEL_NAME",
                      NotificationManager.IMPORTANCE_DEFAULT);
              channel.setDescription("YOUR_NOTIFICATION_CHANNEL_DESCRIPTION");
              mNotificationManager.createNotificationChannel(channel);
          }
          NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(getApplicationContext(), "YOUR_CHANNEL_ID")
                  .setSmallIcon(R.mipmap.ic_launcher) // notification icon
                  .setContentTitle("title") // title for notification
                  .setContentText("Message")// message for notification
                  .setAutoCancel(true); // clear notification after click
          Intent i = new Intent(getApplicationContext(), MainActivity.class);
          PendingIntent pi = PendingIntent.getActivity(this, 0, i, PendingIntent.FLAG_UPDATE_CURRENT);
          mBuilder.setContentIntent(pi);
          mNotificationManager.notify(0, mBuilder.build());
      }
  
      @Nullable
      @Override
      public IBinder onBind(Intent intent) {
          return null;
      }
  }
  