Intents and Uris, for Ringtone Picker

by droozen » Fri, 13 Mar 2009 00:02:59 GMT

Sponsored Links
 I'd like to allow the user to choose a Ringtone from my application,
that I will play later for an alarm. Looking at the javadocs, I see
EXTRA_RINGTONE_DEFAULT_URI in RingtoneManager, and extra that, it
says, is Given to the ringtone picker as a Uri. There is also an
EXTRA_RINGTONE_PICKED_URI that I would get from the returning intent:
Returned from the ringtone picker as a Uri

However, I see no intent.putExtra(String, Uri) function, so no option
to give a Uri. And there is no getUri(String) function in the Bundle
for me to get a Uri in return.

Is the RingtoneManager documentation wrong and it is given and
returned as, say, a String? Or what am I missing?

Intents and Uris, for Ringtone Picker

by Dianne Hackborn » Fri, 13 Mar 2009 02:58:27 GMT

 Uri is a Parcelable, so you can just use intent.putExtra(String,

Dianne Hackborn
Android framework engineer

Note: please don't send private questions to me, as I don't have time to
provide private support.  All such questions should be posted on public
forums, where I and others can see and answer them.


Sponsored Links

Intents and Uris, for Ringtone Picker

by Jason Parekh » Fri, 13 Mar 2009 05:33:15 GMT

 If you're using a preference activity, check out on the
RingtonePreference, it does a lot of the boilerplate work for you.



Intents and Uris, for Ringtone Picker

by droozen » Fri, 13 Mar 2009 05:34:09 GMT

 Ah, thanks. I was only look at what Uri extends (Object) and didn't
notice that it implemented Parcelable. Thanks!


Other Threads

1. Testing Android Game on real device: please help

Hello all,

I am making an android game, but i do not have the money to buy a
developer phone.
The game is not finished but i should it is testable.. and if i dont
test it know i may
have a big problem later... it is playable though.

Is there somebody who has a real device and wants to test the game for
just starting it up and playing it a little bit is good enough.

It's a 2d airplane shoot gane, much like the old raptor game.

If someone is interested please reply, i will sent you
the (singed) APK and with some things i want to test (using both the
buttons as well as touch screen for gameplay).

Could anybody help me out?

Thanks in advance

2. Reg: Porting of camera code with android source code

Hi ,
    I am porting camera code with the android source code .I am 
following all the
procedure but while doing ant, i am getting following error.


[r...@localhost CameraApiTest_alok]# /usr/bin/ant
Exception in thread "main" java.lang.NoClassDefFoundError:
Caused by: java.lang.ClassNotFoundException: not found in 
parent=gnu.gcj.runtime.ExtensionClassLoader{urls=[], parent=null}}
   at gnu.gcj.runtime.SystemClassLoader.findClass(
   at java.lang.ClassLoader.loadClass(
   at java.lang.ClassLoader.loadClass(


i have set all the path like:

export JAVA_HOME=/usr/lib/jvm/java-1.4.2
export ANT_HOME=/usr/share/ant

But still getting the issue.
Can some one tell that where the issue is??

Thanks in advance


3. InstrumentationTestRunner on G1

4. Sensing The Touch Event

5. Reactions of: public boolean onTrackballEvent(MotionEvent event)

6. Redistributing the eclipse plugins

7. How to read the file in sdcard?