how to change the android phone profile mode automatically at specific time.
I want to develope an application which changes set up a schedule and at that specific schedules time, profile mode automatically change to desired mode.
how can i do it ?
Use the setRingerMode() method. Following code set the ringtone to silent mode:
AudioManager audioManager = (AudioManager)getSystemService(Context.AUDIO_SERVICE);
audioManager.setRingerMode(AudioManager.RINGER_MODE_SILENT);
Following are the acceptable values for this function:
RINGER_MODE_NORMAL, RINGER_MODE_SILENT, or RINGER_MODE_VIBRATE. Also add the following permission in the manifest file:
android.permission.MODIFY_AUDIO_SETTINGS
Alarm Manager can be used for execute code at specific time..
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With