开发者

how can i access database from broadcast receiver in android?

开发者 https://www.devze.com 2023-04-03 12:04 出处:网络
i am developing a alarm application using BroadcastReceiver. Here i need to check whether the alarm is on or off from the database. So i need to check the status of the alarm when the broadcast event

i am developing a alarm application using BroadcastReceiver. Here i need to check whether the alarm is on or off from the database. So i need to check the status of the alarm when the broadcast event came. I have to put the database access code in BroadcastReceiver class onReceive() method. Here suggest me if there is any way to access the data from the BroadcastReceiver

thanks in advanc开发者_JS百科e


There is no real problem accessing the DB from the BroadcashReceiver. You will need the context, which you have as part of the BroadcastReceiver onReceive method signature and that's it. If you're facing a specific problem, please tell us what it is

0

精彩评论

暂无评论...
验证码 换一张
取 消