Android 从活动中更改铃声
好吧,我找到了这段代码,运行此代码后,我得到了一些活动(如对话框)可供选择,到目前为止一切顺利。但我的问题是我想选择一些 mp3 作为我的铃声,我该怎么做?
此代码仅给我列表中的默认铃声:
Intent intent = new Intent( RingtoneManager.ACTION_RINGTONE_PICKER);
intent.putExtra( RingtoneManager.EXTRA_RINGTONE_TYPE,
RingtoneManager.TYPE_RINGTONE);
intent.putExtra( RingtoneManager.EXTRA_RINGTONE_TITLE, "Select Tone111");
intent.putExtra( RingtoneManager.EXTRA_RINGTONE_EXISTING_URI,
Uri.parse( "/sdcard/Slipknot - Spit It Out.mp3"));
startActivityForResult( intent, 0);
Well I found this code , after running this I got some activity (as Dialog) to choose from, so far so good. But my problem is that I want to choose some mp3 as my ringtone, how can I do that ?
This code give me only the default ringtones in the list:
Intent intent = new Intent( RingtoneManager.ACTION_RINGTONE_PICKER);
intent.putExtra( RingtoneManager.EXTRA_RINGTONE_TYPE,
RingtoneManager.TYPE_RINGTONE);
intent.putExtra( RingtoneManager.EXTRA_RINGTONE_TITLE, "Select Tone111");
intent.putExtra( RingtoneManager.EXTRA_RINGTONE_EXISTING_URI,
Uri.parse( "/sdcard/Slipknot - Spit It Out.mp3"));
startActivityForResult( intent, 0);
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
解决方案是在音频中添加文件夹铃声( /sdcard/media/audio/ringtone/ )
您可以在此文件夹中添加 mp3,这样它们就会显示在列表中
The solution of this is to add folder ringtone in audio ( /sdcard/media/audio/ringtone/ )
and you can add mp3 in this folder so lather on they will be shown in the list
您可以使用TYPE_ALL
You can use TYPE_ALL