Changing the intention to delete my additional data works fine while the main action still exists, but if it is destroyed / restored, the additional data will be returned.
This is because you are changing your local copy of Intent , and not the main copy, which is supported on the OS where task lists are stored.
If this data is the true state of the activity instance, it should be saved as such through onSaveInstanceState() , and you will get it back through onRestoreInstanceState() . Your library user will need to forward these events to you.
If you do not want to consider this as an instance state, but rather a process state, save the data in singleton mode.
If the data must live outside the lifetime of the process, write it to disk somewhere.
I could save the data in the receiver of the host broadcast application and then use and delete it in my code
If "save data to the broadcast receiver of the host application", it makes no sense. The registered receiver lives for one broadcast and then runs.
CommonsWare Dec 07 '13 at 23:35 2013-12-07 23:35
source share