When my app starts, a splashscreen appears and after this there is a slideshow with images. When user touch a image from slideshow, the app is closed (it is not working in background, it is killed). After that I need to detect phone inactivity to restart this app after 60 seconds of inactivity. Is it possible to do this, to wakeup the app after 60 seconds of inactivity?
Asked
Active
Viewed 759 times
1
-
1Here is your answer. Please use search before asking question. http://stackoverflow.com/questions/4208730/how-to-detect-user-inactivity-in-android – Dmytro Danylyk Dec 02 '11 at 10:51
-
I don't understand that answer, I have see it before. – Gabrielle Dec 02 '11 at 10:52
-
What is getLastInteractionTime or isInForeGrnd ? – Gabrielle Dec 02 '11 at 11:06
2 Answers
0
you could try to set up an AlarmManager
when your app is destroyed, which after 60 seconds will launch your app again.
You may find more about AlarmManager
here: http://developer.android.com/reference/android/app/AlarmManager.html and here for an example: http://justcallmebrian.com/?p=129
Hope this helps!

Dimitris Makris
- 5,183
- 2
- 34
- 54
-
the problem is that app must restart not after 60 seconds the app is closed. It must restart after user not use phone for 60 minutes. – Gabrielle Dec 02 '11 at 10:54
0
possible Use AlarmManager
with BroadcastReciever
. send broadcast after every minute from aLarmManager
. restart app in onReceive

Shailendra Singh Rajawat
- 8,172
- 3
- 35
- 40