Is there any way to get finished or successful work timestamp?
WorkManager.getInstance().getWorkInfosByTagLiveData(groupId)
this code gives WorkInfo
.
I'm sure that WorkManager
has timestamps to manage Work
, but how to obtain it?
I'm inspecting androidx.work.workdb
file which is located at /data/data/com.example/databases
. As of WorkManager 2.2.0 here're the columns that are present in the WorkSpec
table:
androidx.work.OverwritingInputMerger
) As can be deduced, there doesn't exist a field, which will reflect the timestamp when a particular work has been completed, because as per my understanding WorkManager
doesn't need that field.
Hence, your only option is upon work's successful completion manually saving the timestamp using shared prefs or another SQLite table.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.