Naka-Kazz avatar image
Naka-Kazz asked

AlarmManager on FireHD Tablet

I want to start my application on a specified time. And, I know we can use AlarmManager on normal Android devices. So, I make a code as following, but the code did not work on FireHD tabled. How can I start my application by AlarmManager?

My code is

val intent = Intent(applicationContext,
val sender =PendingIntent.getBroadcast(this, 0, intent, 0)

val am =getSystemService(Context.ALARM_SERVICE) as AlarmManager
if(Build.VERSION.SDK_INT >= 23)
    am.setAndAllowWhileIdle(AlarmManager.RTC_WAKEUP, cal.getTimeInMillis(), sender)
    am.setExact(AlarmManager.RTC_WAKEUP, cal.getTimeInMillis(), sender)

Thank you for your support!

fire tablet
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

0 Answers