curioustechizen / android-ago

An Android TextView that always displays an auto refreshing relative time span with respect to a reference time
657 stars 109 forks source link

Save timeago when close the app #58

Open jamescarl15 opened 6 years ago

jamescarl15 commented 6 years ago

Can I save the "setReferenceTime" even if the app destroys?

curioustechizen commented 6 years ago

This library implements onSaveInstanceState() and onRestoreInstanceState() so that the reference time is retained for example across configuration changes.

However, it does not do anything to persist the reference time when the activity is finished or if your app process is killed when it is in the background. You will need to do that on your own.

I see that RelativeTimeTextView does not have a getReferenceTime() method. I've created #59 to track this. Once that is in implemented you can use getReferenceTime() and save it to persistent storage.