I am using SharedPreference
in my application. When application is started I am saving some data in it. I have one Activity
on which I am performing all Fragment
operations like adding, replacing etc. I need to remove that stored data from preference if I am not performing any actions in application i.e. application is idle for some time. How to detect that user is not performing some operations in app and remove data from preference after some specified time when app is stable?
Asked
Active
Viewed 100 times
0

Phantômaxx
- 37,901
- 21
- 84
- 115

Satyam Gondhale
- 1,415
- 1
- 16
- 43
-
Have you checked [this](https://stackoverflow.com/questions/4208730/how-to-detect-user-inactivity-in-android)? – Piyush Dec 27 '18 at 13:25
-
One way to use rx. This library can be useful for your task https://github.com/JakeWharton/RxBinding – Artem Botnev Dec 27 '18 at 13:28