Saving data in BroadcastReceiver while phone is locked

What I would like to do is be able to both get the BroadcastReceiver to work on locked screen (I read here that including the receiver in the manifest would allow it) as well as keep the data from one receiver call to the other.

However, here, it says that data will go away after a single onReceive() call (which is something I have also noticed when testing)

Therefore my question is: how can I keep the data from one receiver call to the other?

I am thinking of saving in a text file but this would not be ideal. Any alternatives?