<bdo id='jXBMU'></bdo><ul id='jXBMU'></ul>

    <small id='jXBMU'></small><noframes id='jXBMU'>

    <tfoot id='jXBMU'></tfoot>
  • <i id='jXBMU'><tr id='jXBMU'><dt id='jXBMU'><q id='jXBMU'><span id='jXBMU'><b id='jXBMU'><form id='jXBMU'><ins id='jXBMU'></ins><ul id='jXBMU'></ul><sub id='jXBMU'></sub></form><legend id='jXBMU'></legend><bdo id='jXBMU'><pre id='jXBMU'><center id='jXBMU'></center></pre></bdo></b><th id='jXBMU'></th></span></q></dt></tr></i><div id='jXBMU'><tfoot id='jXBMU'></tfoot><dl id='jXBMU'><fieldset id='jXBMU'></fieldset></dl></div>
        <legend id='jXBMU'><style id='jXBMU'><dir id='jXBMU'><q id='jXBMU'></q></dir></style></legend>

      1. 如何使用 RingtoneManager.ACTION_RINGTONE_PICKER 设置铃声?

        时间:2023-07-08
        <i id='sXUm9'><tr id='sXUm9'><dt id='sXUm9'><q id='sXUm9'><span id='sXUm9'><b id='sXUm9'><form id='sXUm9'><ins id='sXUm9'></ins><ul id='sXUm9'></ul><sub id='sXUm9'></sub></form><legend id='sXUm9'></legend><bdo id='sXUm9'><pre id='sXUm9'><center id='sXUm9'></center></pre></bdo></b><th id='sXUm9'></th></span></q></dt></tr></i><div id='sXUm9'><tfoot id='sXUm9'></tfoot><dl id='sXUm9'><fieldset id='sXUm9'></fieldset></dl></div>

          • <legend id='sXUm9'><style id='sXUm9'><dir id='sXUm9'><q id='sXUm9'></q></dir></style></legend>

              <bdo id='sXUm9'></bdo><ul id='sXUm9'></ul>
            • <small id='sXUm9'></small><noframes id='sXUm9'>

                  <tbody id='sXUm9'></tbody>

                <tfoot id='sXUm9'></tfoot>

                  本文介绍了如何使用 RingtoneManager.ACTION_RINGTONE_PICKER 设置铃声?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我尝试在这里找到解决方案,但只有自己/选择的文件的解决方案,而不是我调用选择器时的代码.当用户按下按钮时,我使用以下代码:

                  I try to find solution here, but there are only solution for own/selected file, not for code when I call picker. I use following code when user press button:

                  Intent intent = new Intent(RingtoneManager.ACTION_RINGTONE_PICKER);
                  intent.putExtra(RingtoneManager.EXTRA_RINGTONE_TITLE, "Select ringtone for notifications:");
                  intent.putExtra(RingtoneManager.EXTRA_RINGTONE_SHOW_SILENT, false);
                  intent.putExtra(RingtoneManager.EXTRA_RINGTONE_SHOW_DEFAULT, true);
                  intent.putExtra(RingtoneManager.EXTRA_RINGTONE_TYPE,RingtoneManager.TYPE_NOTIFICATION);
                  ActivityCurrent.this.startActivityForResult(intent,999);
                  

                  这个显示铃声选择器,用户可以选择想要的铃声,但我错过了两件事:- 打开时不显示当前铃声- 点击确定时不保存铃声

                  This show ringtone picker, user can choose what ringtone wants, but I miss two things: - it doesnt show current ringtone when it open - it not save ringtone when it is clicked on OK

                  我仍然无法找到如何使用已选择的当前铃声打开 RINGTONE_PICKER.有什么想法吗?

                  I still cant find way how to open RINGTONE_PICKER with already selected current ring tone. Any idea?

                  Intent intent = new Intent(RingtoneManager.ACTION_RINGTONE_PICKER);
                  intent.putExtra(RingtoneManager.EXTRA_RINGTONE_TITLE, "Select ringtone for notifications:");
                  intent.putExtra(RingtoneManager.EXTRA_RINGTONE_SHOW_SILENT, false);
                  intent.putExtra(RingtoneManager.EXTRA_RINGTONE_SHOW_DEFAULT, true);
                  intent.putExtra(RingtoneManager.EXTRA_RINGTONE_TYPE,RingtoneManager.TYPE_NOTIFICATION);
                  ActivityCurrent.this.startActivityForResult(intent,999);
                  

                  推荐答案

                  你必须实现onActivityResult()来接收用户选择的结果,然后保存.

                  You must implement onActivityResult() to receive result from user's pick, then save it.

                  if (resultCode == RESULT_OK) {
                      Uri uri = intent.getParcelableExtra(RingtoneManager.EXTRA_RINGTONE_PICKED_URI);
                      if (uri != null) {
                      String ringTonePath = uri.toString();
                  }
                  

                  这里是一个例子:http://www.ceveni.com/2009/07/ringtone-picker-in-android-with-intent.html

                  更新

                  RingtoneManager.setActualDefaultRingtoneUri(
                      myActivity,
                      RingtoneManager.TYPE_RINGTONE,
                      uri);
                  

                  你必须这样称呼它:)

                  这篇关于如何使用 RingtoneManager.ACTION_RINGTONE_PICKER 设置铃声?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:以编程方式设置 Android IP、DNS、GATEWAY 设置 下一篇:'设置&lt;NSObject&gt;'没有名为“anyObject"的成员.

                  相关文章

                  <legend id='pNFLK'><style id='pNFLK'><dir id='pNFLK'><q id='pNFLK'></q></dir></style></legend>

                  <small id='pNFLK'></small><noframes id='pNFLK'>

                    <tfoot id='pNFLK'></tfoot>
                      <bdo id='pNFLK'></bdo><ul id='pNFLK'></ul>

                    <i id='pNFLK'><tr id='pNFLK'><dt id='pNFLK'><q id='pNFLK'><span id='pNFLK'><b id='pNFLK'><form id='pNFLK'><ins id='pNFLK'></ins><ul id='pNFLK'></ul><sub id='pNFLK'></sub></form><legend id='pNFLK'></legend><bdo id='pNFLK'><pre id='pNFLK'><center id='pNFLK'></center></pre></bdo></b><th id='pNFLK'></th></span></q></dt></tr></i><div id='pNFLK'><tfoot id='pNFLK'></tfoot><dl id='pNFLK'><fieldset id='pNFLK'></fieldset></dl></div>