简体   繁体   English

已选择默认选项的Android铃声选择器列表

[英]Android Ringtone picker list with default option selected

I am trying to display a window picker dialog in android with the default selection to be instead of "None" how it is currently, to be selected the default phone's alarm/ringtone. 我试图在android中显示一个窗口选择器对话框,默认选择是“无”当前如何,选择默认手机的闹钟/铃声。

Here is the code I tried: 这是我试过的代码:

Intent intent = new Intent(RingtoneManager.ACTION_RINGTONE_PICKER);
            intent.putExtra(RingtoneManager.EXTRA_RINGTONE_TYPE,
                    RingtoneManager.TYPE_NOTIFICATION
                            | RingtoneManager.TYPE_RINGTONE);
            intent.putExtra(RingtoneManager.EXTRA_RINGTONE_SHOW_DEFAULT, true);
            intent.putExtra(RingtoneManager.EXTRA_RINGTONE_DEFAULT_URI,
                    RingtoneManager
                            .getDefaultUri(RingtoneManager.TYPE_NOTIFICATION));
            startActivityForResult(intent, 0);

See the screenshot for details. 有关详情,请参见屏幕截图 在此输入图像描述

Have you tried this ? 你试过这个吗? Ringtone picker - radio button set 铃声选择器 - 单选按钮设置

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM