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,
Parcelable).






-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

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.

jason





--~--~---------~--~----~------------~-------~--~----~



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
me,
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: 
org.apache.tools.ant.launch.Launcher
   at gnu.java.lang.MainThread.run(libgcj.so.7rh)
Caused by: java.lang.ClassNotFoundException: 
org.apache.tools.ant.launch.Launcher not found in 
gnu.gcj.runtime.SystemClassLoader{urls=[file:/usr/bin/build-classpath,file:/usr/lib/jvm/java-1.4.2/lib/tools.jar],
 
parent=gnu.gcj.runtime.ExtensionClassLoader{urls=[], parent=null}}
   at java.net.URLClassLoader.findClass(libgcj.so.7rh)
   at gnu.gcj.runtime.SystemClassLoader.findClass(libgcj.so.7rh)
   at java.lang.ClassLoader.loadClass(libgcj.so.7rh)
   at java.lang.ClassLoader.loadClass(libgcj.so.7rh)
   at gnu.java.lang.MainThread.run(libgcj.so.7rh)

********************************



i have set all the path like:

export JAVA_HOME=/usr/lib/jvm/java-1.4.2
export ANT_HOME=/usr/share/ant
PATH=$PATH:$HOME:$JAVA_HOME:$ANT_HOME:

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

Thanks in advance
Alok




--~--~---------~--~----~------------~-------~--~----~

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?