title: Starting activity at specific hour using alarm manager in Jetpack Compose
body: <p>I'm developing an App using Jetpack Compose, and I want a specific page to open at a specific hour even when the app is not open.</p>
  <p>I'm currently using this code:</p>
  <pre><code>val alarmManager =
          context.getSystemService(Context.ALARM_SERVICE) as AlarmManager
  
      val calendar: Calendar = getInstance().apply {
          timeInMillis = System.currentTimeMillis()
          set(Calendar.HOUR_OF_DAY, 3)
          set(Calendar.MINUTE, 54)
      }
  
      alarmManager.setRepeating(
          AlarmManager.RTC_WAKEUP,
          calendar.timeInMillis,
          1000 * 5,
          PendingIntent.getActivity(context, 0,
              Intent(context, SecondActivity::class.java), FLAG_IMMUTABLE)
      )
  </code></pre>
  <p>It opens the page at around 3:54 but if the app is not open or is in the background the page is not shown.</p>
  <p>It is only shown a few seconds after I open the app again or select it from the background.</p>