• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

Dismissing Alarm when user uses Back or Home  RSS feed

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am building an alarm app and have run into a problem I can't seem to find the answer to. Here is the problem... Everything works as expected except when a user uses the Back or Home button while the alarm is playing. The dismiss Alarm dialog closes but the alarm keeps playing with no way to stop it other than forcing the program to close in Settings. I have tried stopping the mediaplayer in the onPause and onStop methods. This causes proper behavior if the device is awake, but if asleep it prevents the alarm from playing at all when woken up. If the device is asleep, the alarm dialog pops up, but the alarm makes a brief noise and stops.

I am sooooo close to getting this working right and I'm thinking that there is something simple I'm overlooking. I have searched for days high and low on the Internet and cannot come up with anything that helps.

Here is the AlarmScreen activity

 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!