Ned Fox wrote:
> I have an application that is silencing the ringer while it is open,
> then when it closes it unsilences it. Currently I am doing these two
> things in OnStart and OnStop. The only problem (and it's a big one) is
> that when a phone call comes in, it stops my application (calling
> OnStop), then rings at its normal volume.

I would think this is a good thing, at least from the user's standpoint.

> Is there any way to get around this? 

Around what?

Your activity is going to be stopped, because it is losing the
foreground. That will be true if a call comes in, or the user presses
HOME, or the user presses BACK, or the user slides down the notification
drawer, or...

> I tried using onCreate and
> onDestroy, but I want to restore the original volume setting as soon
> as the program is closed, which onDestroy doesn't seem to do.

While this should work, I seriously question whether it is the right
thing by users. What you are saying is that you want total control over
their ringer volume for an indeterminate period of time. After all, if
they press HOME, they may not come back to your activity for *weeks*,
yet it might hang out in memory that long, if the user has a device with
a lot of RAM and doesn't use a lot of apps.

What gives you the right to say their phone shouldn't ring for weeks?

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://twitter.com/commonsguy

_Beginning Android 2_ from Apress Now Available!

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to