5

I am trying to get next alarm clock time on android. I use two known methods:

1: ( ( AlarmManager )Global.Context.getSystemService(Context.ALARM_SERVICE) ).getNextAlarmClock().getTriggerTime() // for SDK API 21+

2: Settings.System.getString(Global.Context.getContentResolver(), Settings.System.NEXT_ALARM_FORMATTED) // for SDK API 20-

This work ok on most part of devices. But on some devices with MIUI the results are wrong (for both methods 1 or 2). The results seem to be random without any consistence with alarm clock. May be these result are corresponding to calendar events notifications. But not with alarm clock.

The users of my app, that encounter such a problem, report me about other apps that show next alarm clock time correct. So I know that the solution exists.

Alexey
  • 51
  • 2
  • 1
    There are severals discussion and solutions in Chinese forum, but the only correct solution is that you should contact MIUI Supporters and let them add you in **Whitelist**. I have no idea If you need to pay or not, but I tried nearly amost of ways that all failed. (Or you could ban Xiaomi phones in your google store console) – Tokenyet Aug 06 '18 at 07:35
  • Thank you for a reply. I had been waiting for it for a long time. And did you managed to add your app to the whitelist? – Alexey Dec 19 '18 at 15:40
  • The only one working Alarm I know is **Alarmy**, developed by China's Team. If you still want to make It work on MIUI, you might want to give it a contact. – Tokenyet Dec 19 '18 at 15:56

0 Answers0