Notification to play sound

by droozen » Fri, 13 Mar 2009 01:10:04 GMT


Sponsored Links
 So I've set up my app to have a repeating alarm, daily, as the user
decides, using AlarmManager. I want the user to select a ringtone for
it. This works fine, too. I store the string of the Uri they selected
in a preference to pull it back when my alarm gets run. To pull it
back, I do this:

NotificationManager notifManager = (NotificationManager)
getSystemService(Context.NOTIFICATION_SERVICE);
Notification notif = new Notification(-notification stuff-);
SharedPreferences settings = getSharedPreferences(PREFS_NAME, 0);
String reminderSound = settings.getString(getString
(R.string.RingtoneReminder), null);
if(reminderSound != null){
        notif.sound = Uri.parse(reminderSound);
}

So I set the Notification's sound field to the Uri of my notification.
Later, when I call the notifManager.notify(rowId, notif), the
notification still pops up, but the sound doesn't play.

How do I get the sound to play?
--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. [id-gps] WTA: Google Maps 5.0.0 for Android

wes ngerti kan jawabane.. :D

kemaren ke bandung yo om..?
om syd kalo gak salah lagi di bali tuh,
tapi sepertinya gak mau diganggu,
latitude-nya juga dimatiin...


Iftiron Y. Trisnanto

2010/12/26 Ngadino <ngadinos...@gmail.com>


-- 
===============
"

2. Documentation errors for LocationManager.requestSingleUpdate() ?

This is a new method in Android 2.3's LocationManager. It says
basically the same thing as what it says for requestLocationUpdates(),
except that there's no way to specify a minTime or minDistance. From
the name I would guess that my listener is going to be called once and
that's it, maybe as soon as a reliable location is available. But the
descriptions start with this:

Registers the current activity to be notified periodically by the
named provider. Periodically, the supplied LocationListener will be
called with the current Location or with status updates.

"Periodically" is not defined nor settable it seems. And why would
this method be called requestSingleUpdate if it gets multiple updates?
Does anyone know how to use these methods?

Thanks.

-- 

3. Paging bos Dedi Sopian

4. Upgrade HTC Wildfire - Next Generation

5. Oot : salam kenal

6. OOT: Salam Kenal dari bt

7. Oot: nonton metro yuk ada android