Hi,

On Fri, May 1, 2009 at 8:13 PM, Olivier Tournaire <[email protected]> wrote:

> Thank you Yusuf,
>
> On Fri, May 1, 2009 at 6:44 PM, Yusuf T. Mobile 
> <[email protected]>wrote:
>
>>
>> To access the ringtones, I recommend android.media.RingtoneManager:
>>
>> http://developer.android.com/reference/android/media/RingtoneManager.html
>
>
> Right ! This is exactly what I need !
>
> To show a ringtone picker to the user, use the
>> android.intent.action.RINGTONE_PICKER intent to launch the picker as a
>> subactivity.
>
>
> I am sorry, but it is not clear to me how to show a ringtone picker. Can
> you help  me ?
>

I found a code sample, however, it does not seem to work. Here it is:

    private void startRingPick() {
    Intent intent = new Intent(RingtoneManager.ACTION_RINGTONE_PICKER);
    Uri uri =
ContentUris.withAppendedId(MediaStore.Audio.Media.EXTERNAL_CONTENT_URI, 1l);
    // Don't show 'Silent'
    intent.putExtra(RingtoneManager.EXTRA_RINGTONE_SHOW_SILENT, true);

    intent.putExtra(RingtoneManager.EXTRA_RINGTONE_EXISTING_URI, uri);
    startActivityForResult(intent, ACTIVITY_SET_RINGTONE);
    }

It does not work: I simply have a black screen, with nothing ... It returns
weel when I press escape.
Another thing:

RingtoneManager rtm = new RingtoneManager(this);
rtm.getCursor().getCount();

gives "0". What am I doing wrong ?

Regards,

Olivier



>
> Regards,
>
> Olivier
>
>>
>>
>>
>>
>> Yusuf Saib
>> Android
>> ·T· · ·Mobile· stick together
>> The views, opinions and statements in this email are those of the
>> author solely in their individual capacity, and do not necessarily
>> represent those of T-Mobile USA, Inc.
>>
>>
>>
>>
>>
>> On May 1, 6:24 am, Mark Murphy <[email protected]> wrote:
>> > Olivier Tournaire wrote:
>> > > My intent is to make the phone ring.
>> >
>> > If by "ring" you mean you want to play a sound, use MediaPlayer or
>> > SoundPool (or perhaps AudioTrack -- I have not looked into that class),
>> > and use AlarmManager to schedule it. Also, be sure to use a WakeLock to
>> > ensure the device is awake long enough for your ring to be completed.
>> >
>> > If by "ring" you mean actually have a call come into the device, you
>> > would have to initiate the call from someplace other than the device
>> > itself, which means this is no longer an Android issue.
>> >
>> > --
>> > Mark Murphy (a Commons Guy)http://commonsware.com|
>> http://twitter.com/commonsguy
>> >
>> > Warescription: Three Android Books, Plus Updates, $35/Year
>> >>
>>
>

--~--~---------~--~----~------------~-------~--~----~
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