curioustechizen / android-ago

An Android TextView that always displays an auto refreshing relative time span with respect to a reference time

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Save timeago when close the app

jamescarl15 opened this issue · comments

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

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.