Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

alarm manager not working in background #2

Open
chander-60905 opened this issue Apr 16, 2019 · 2 comments
Open

alarm manager not working in background #2

chander-60905 opened this issue Apr 16, 2019 · 2 comments

Comments

@chander-60905
Copy link

In Realme 2 when app is closed the alarm manager does not work even when app is set to auto start and escape from power saver mode manually but still alarm does not work

@ezinal
Copy link
Owner

ezinal commented Apr 16, 2019

Hi. You can just change setRepeating() in MainActivity class to setExactAndAllowWhileIdle() and it will work fine for API levels higher than 23. You should also change your minSdkVersion in build.gradle to 23. I'm currently working on an update to this project and i will release it soon. Tell me if it works on your device.

@chander-60905
Copy link
Author

i have tried using setExactAndAllowWhileIdle() as i want to make alarm for once only but it didn't work when app is closed in realme 2 but it is working in redmi note 5 pro without turning auto start on and without battery optimization and in one plus 6t it is working by turning off the battery optimization off.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants