我正在尝试在android中显示一个窗口选择器对话框,默认选择是而不是当前的“无”,选择默认手机的闹钟/铃声。这是我试过的代码:Intentintent=newIntent(RingtoneManager.ACTION_RINGTONE_PICKER);intent.putExtra(RingtoneManager.EXTRA_RINGTONE_TYPE,RingtoneManager.TYPE_NOTIFICATION|RingtoneManager.TYPE_RINGTONE);intent.putExtra(RingtoneManager.EXTRA_RINGTONE_SHOW_
我正在使用RingtoneManager,显然在某些手机上它一直返回null。我知道如果声音是无声的或找不到音调,它会返回null。开声音有提示音为什么会返回null?该代码适用于我的nexuss....这是我正在使用的:Ringtoneringtone;ringtone=RingtoneManager.getRingtone(context,RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION));if(ringtone==null){Log.d("Debug","ringtoneisnull");}else{
问题:我发现java.net.URI有一个create(Stringuri)选项,但android.net.uri没有。更具体地说:我正在尝试获取RingtoneManager的RingtonePicker的输出并使用SetActualDefaultRingtoneUri将其设置为默认铃声:Intentintent=newIntent(RingtoneManager.ACTION_RINGTONE_PICKER);intent.putExtra(RingtoneManager.EXTRA_RINGTONE_TYPE,RingtoneManager.TYPE_RINGTONE);inte
我尝试在这里找到解决方案,但只有自己/选择的文件的解决方案,而不是我调用选择器时的代码。当用户按下按钮时,我使用以下代码:Intentintent=newIntent(RingtoneManager.ACTION_RINGTONE_PICKER);intent.putExtra(RingtoneManager.EXTRA_RINGTONE_TITLE,"Selectringtonefornotifications:");intent.putExtra(RingtoneManager.EXTRA_RINGTONE_SHOW_SILENT,false);intent.putExtra(Ri
我尝试在这里找到解决方案,但只有自己/选择的文件的解决方案,而不是我调用选择器时的代码。当用户按下按钮时,我使用以下代码:Intentintent=newIntent(RingtoneManager.ACTION_RINGTONE_PICKER);intent.putExtra(RingtoneManager.EXTRA_RINGTONE_TITLE,"Selectringtonefornotifications:");intent.putExtra(RingtoneManager.EXTRA_RINGTONE_SHOW_SILENT,false);intent.putExtra(Ri
我的Activity中有一个默认铃声:remindRingtoneView=(TextView)findViewById(R.id.remind_ringtone);remindRingtoneView.setText(RingtoneManager.getRingtone(NewReminder.this,ringtone_uri).getTitle(NewReminder.this));在这一行之后,我在LogCat中有一个调试行,标签='Ringtone'和消息='成功创建本地播放器'.当我完成Activity和系统垃圾收集器时,它做得很好,我在LogCat中收到一条警告消息='
这个问题可能与thisquestion重复但我发现代码有些不同,所以我提出了一个新问题。问题是我无法在RingtonePicker中设置选取的铃声。我用SupportLibrary和AndroidAnnotations,也许它会导致这样的问题(尽管我对此表示怀疑)。我有一个带有按钮的fragment。单击按钮时,将触发RingtonePicker。用户选择铃声,应用程序将其保存在SharedPreference中。下次当用户打开RingtonePicker时,应该检查之前选择的铃声,我不能这样做。这是我的fragment@EFragment(R.layout.pref_page)pub
我使用Notification.Builder建立一个通知。现在我想使用默认的声音通知:builder.setSound(Urisound)但是默认通知的Uri在哪里? 最佳答案 尝试使用RingtoneManager获取默认通知Uri为:Uriuri=RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);builder.setSound(uri); 关于android-Uri默认声音通知?,我们在StackOv
我使用Notification.Builder建立一个通知。现在我想使用默认的声音通知:builder.setSound(Urisound)但是默认通知的Uri在哪里? 最佳答案 尝试使用RingtoneManager获取默认通知Uri为:Uriuri=RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);builder.setSound(uri); 关于android-Uri默认声音通知?,我们在StackOv