title: Kotlin AlarmManager and BroadcastReceiver not working
body: <p>I'm trying to set an alarm with AlarmManager, but my BroadcastReceiver never gets called.  Here is my snippet.</p>
  
  <pre><code>    val receiver = object : BroadcastReceiver() {
          override fun onReceive(context: Context, intent: Intent) {
              //Never gets hit
          }
      }
      context.registerReceiver(receiver, IntentFilter(LOCAL_NOTIFICATION))
  
      val intent = Intent()
      intent.action = LOCAL_NOTIFICATION
  
      val alarmManager = context.getSystemService(ALARM_SERVICE) as? AlarmManager
      val pendingIntent = PendingIntent.getService(context, 1, intent, PendingIntent.FLAG_UPDATE_CURRENT)
  
      val calendar = Calendar.getInstance()
  
      calendar.add(Calendar.SECOND, 10)
  
      alarmManager?.set(AlarmManager.RTC_WAKEUP, calendar.timeInMillis, pendingIntent)
  </code></pre>
  
  <p>I've tried registering a broadcast receiver in AndroidManifest.xml but nothing seems to be working.</p>