简体   繁体   中英

how to delete sms using alarm manager

I would like create an app that can clear received sms, which are older than certain amount of time. What I do not know is that, what value should I use to trigger that alarm manager and how to update the alarm manager, so that it can delete the next message. Thank you in advance.

Well, you can follow these steps:

Step 1: Start a service Register broadcast receiver for receiving the event of certain time everyday. (Like alarm that would go off on 9 AM everyday)

Step 2: You can check for old SMS in onReceive() of your receiver.

Step 3: Delete those SMS which are older than certain timelimit.

So, it will run everyday to delete old SMS.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM