Ringtone picker - radio button set

后端 未结 2 727
独厮守ぢ
独厮守ぢ 2020-12-31 00:49

I can successfully bring up a ringtone picker and get a resultant uri with the following code...

    selsound_button.setOnClickListener(new OnClickListener()         


        
相关标签:
2条回答
  • 2020-12-31 01:13

    You need to add

       intent.putExtra(RingtoneManager.EXTRA_RINGTONE_EXISTING_URI, currenturi);
    

    to set the radiobutton

    0 讨论(0)
  • 2020-12-31 01:25

    This is the Exact Code for you.

    selsound_button.setOnClickListener(new OnClickListener() {
    
            public void onClick(View arg0) {
                final Uri currentTone= RingtoneManager.getActualDefaultRingtoneUri(YourActivity.this, RingtoneManager.TYPE_ALARM);
                Intent intent = new Intent(RingtoneManager.ACTION_RINGTONE_PICKER);
                intent.putExtra(RingtoneManager.EXTRA_RINGTONE_TYPE, RingtoneManager.TYPE_ALARM);
                intent.putExtra(RingtoneManager.EXTRA_RINGTONE_TITLE, "Select Tone");
                intent.putExtra(RingtoneManager.EXTRA_RINGTONE_EXISTING_URI, currentTone);
                intent.putExtra(RingtoneManager.EXTRA_RINGTONE_SHOW_SILENT, false);
                intent.putExtra(RingtoneManager.EXTRA_RINGTONE_SHOW_DEFAULT, true);
                startActivityForResult(intent, TONE_PICKER);
            }
    
        });
    
    0 讨论(0)
提交回复
热议问题