Skip to content Skip to sidebar Skip to footer

Bringing My Alarm To The Front

I had a few problems with my alarm that are in a another thread here if anyone could help but anyway here is a new question. If I set an alarm using my app, say for 5 minutes from

Solution 1:

Don't move your activity to the front automatically. It's as annoying as a pop-up ad! Do you really want to try to interrupt the user who's trying to look up a phone number?

Instead, use a Service. When you want to tell the user something, post a status bar notification. You can set up the notification to bring up an Activity when the notification is clicked.

Most alarms are implemented in a Service.

Solution 2:

Have you looked into the AlarmManager? http://developer.android.com/reference/android/app/AlarmManager.html. I've used it in the future to fire Intents for Notifications. The Notification can then open an Activity for the user when they select the Notification from the Android Notification Bar.

Post a Comment for "Bringing My Alarm To The Front"