4

This question already has an answer here:

If you are editing the text in the android app, then switch to another app, and return back to the app all the edits are lost.

This seems to happens when the OS kills the app after pausing in order to reclaim RAM in low memory conditions, but maybe there are other conditions too.

Apparently, the draft is not saved in onPause, therefore as a result even an alarm which goes off, and is then discarded will lead to all edits being lost and replaced with the old text.

You'll probably need to add some handing to onSaveInstanceState and onRestoreInstanceState, and make sure it is persisted to physical storage, so that it works even if the OS purged the app from memory.

marked as duplicate by ShaWiz, gnat, S.L. Barth, nicael, Patrick Hofman Jul 3 '15 at 9:52

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

Browse other questions tagged .