How do I make my phone silent at a particular time, even when the Android app is not running?

StackOverflow https://stackoverflow.com/questions/22422179

سؤال

I'm making an Android app which would make the phone go on silent or in vibration mode at a user defined time.

I've learned how to toggle between silent mode to normal mode and to get the current time using calendar.

I want to know how can I turn my phone silent at a particular time even the app is not running?. Basically I want it to be like an alarm clock to make my phone silent.

هل كانت مفيدة؟

المحلول

create a pending intent using alarmamanager wakeup when ever you want to set up phone silent

for alarma manager check here

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top