How to reschedule Alarm Manager on Preference Change

淺唱寂寞╮ 提交于 2019-12-04 13:38:54

There is OnPreferenceChangeListener just set it and implement it. As i remember you set it to the preference. So you need to get this preference findPreference("myAlarmInterval"); and then set the listener

This will work if your service doesn't use the same preference. According to the developer docs it will be called when - has been changed by the user - is about to be set and/or persisted.

So, a new preference's value is not yet available to your service.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!