1. Is your ringtone added to the media lib?
2. Is your tingtone too large? Because it will return null while you
cropping an image and the size is too large.

This is what I guess. Please test it yourself.
Another way to find the answer if reading the android source code.

On 5月2日, 下午9时50分, Bowz <nick.j.ba...@gmail.com> wrote:
> I am having trouble debugging my app where i have an sub activity
> which uses the static method getRingtone.  Sometimes it works,
> sometimes it returns null.  Specifically its in a custom listview in
> the getView function.  Strangely enough, i have another sub activity
> which this always works.  I suppose the only difference would be the
> context passed in.  I am looking for tips on how to determine why
> RingtoneManager.getRingtone is returning null, and what those
> conditions might be.
>
> simply put, here is the sample code line:
> Ringtone rt = RingtoneManager.getRingtone(context,
> Uri.parse(strTemp));
>
> strTemp is a string that looks like content://media/external/audio/media/9
>
> I verified that Uri.parse returns a Uri object, context is what is
> passed into the ListActivity constructor.
> Any advice is appreciated.
>
> Note: beginner java & android programmer, experienced in C++/C#
> windows, etc..
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group 
> athttp://groups.google.com/group/android-developers?hl=en

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

Reply via email to