0

I have a launch activity which contains a broadcastReceiver, where I will start a service to download a key file which will send a broadcast when the operation is done . During the app, several downloading operations will be taken, and there is also other receivers somewhere. I just care the first downloading in launch activity and it will be finish when done.

Question: Everytime I restart my app , the broadcast from last time will disrupt the plan. How can I get rid of them .

4

1 回答 1

0

您可以使用以下命令删除粘性广播:

public abstract void removeStickyBroadcast (Intent intent)

(更多信息: http: //developer.android.com/reference/android/content/Context.html#removeStickyBroadcast (android.content.Intent )

于 2013-09-27T10:38:28.460 回答