This week's book giveaway is in the Big Data forum.
We're giving away four copies of Elasticsearch in Action and have Radu Gheorghe & Matthew Lee Hinman on-line!
See this thread for details.
The moose likes Android and the fly likes auto lock application after fixed time Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Elasticsearch in Action this week in the Big Data forum!
JavaRanch » Java Forums » Mobile » Android
Bookmark "auto lock application after fixed time" Watch "auto lock application after fixed time" New topic

auto lock application after fixed time

yash wardhan
Ranch Hand

Joined: Jan 22, 2008
Posts: 46

I want to know if there is a way to get the notification for inactivity timer.
My scenario is as given here

If user remains idle for 1 min. then I should get the notification so that I can exit the application.
How does the emulator/device gets the notification of idleness and the back light goes dim?

Can someone please guide me how to implement it or point to a sample application.

Thanks in advance
Anirudh Aithal

Joined: Jun 09, 2009
Posts: 7

You can use the combination of WakeLock and onUserInteraction() method to accomplish this.

I agree. Here's the link:
subject: auto lock application after fixed time