Android 更改铃声选择器对话框样式
我正在开发一个应用程序,该应用程序在某个点上有一个通知。我实现了两种方法,使用户可以更改通知声音。如何更改铃声选择器对话框的样式 这是我的铃声选择器代码:Android 更改铃声选择器对话框样式,android,notifications,ringtonemanager,Android,Notifications,Ringtonemanager,我正在开发一个应用程序,该应用程序在某个点上有一个通知。我实现了两种方法,使用户可以更改通知声音。如何更改铃声选择器对话框的样式 这是我的铃声选择器代码: public void getNotification(){ Intent intent = new Intent(RingtoneManager.ACTION_RINGTONE_PICKER); intent.putExtra(RingtoneManager.EXTRA_RINGTONE_TYPE, RingtoneMana
public void getNotification(){
Intent intent = new Intent(RingtoneManager.ACTION_RINGTONE_PICKER);
intent.putExtra(RingtoneManager.EXTRA_RINGTONE_TYPE, RingtoneManager.TYPE_NOTIFICATION);
intent.putExtra(RingtoneManager.EXTRA_RINGTONE_TITLE, "Select Tone");
intent.putExtra(RingtoneManager.EXTRA_RINGTONE_EXISTING_URI, (Uri) null);
this.startActivityForResult(intent, 5);
}
我已经有了警报对话的自定义样式(R.style.AlertDialogCustom)。如何在我的铃声选择器对话框中使用此自定义样式?我通过将这行代码添加到上述方法中,成功地解决了我的问题:
public void getNotification(){
Intent intent = new Intent(RingtoneManager.ACTION_RINGTONE_PICKER);
intent.putExtra(RingtoneManager.EXTRA_RINGTONE_TYPE, RingtoneManager.TYPE_NOTIFICATION);
intent.putExtra(RingtoneManager.EXTRA_RINGTONE_TITLE, "Select Tone");
intent.putExtra(RingtoneManager.EXTRA_RINGTONE_TYPE, R.style.AlertDialogCustom); //this one
intent.putExtra(RingtoneManager.EXTRA_RINGTONE_EXISTING_URI, (Uri) null);
this.startActivityForResult(intent, 5);
}
这是与我的自定义AlertDialog对应的样式:
<style name="AlertDialogCustom" parent="Theme.AppCompat.Light.Dialog.Alert">
<item name="colorPrimary">@color/primary</item>
<item name="colorPrimaryDark">@color/maroon</item>
<item name="colorAccent">@color/primary</item>
</style>
@颜色/原色
@颜色/栗色
@颜色/原色
我也想知道。你找到解决办法了吗?事实上我找到了。我只是回答了我自己的问题。这并没有改变我的想法。你要打两次额外的铃声,对吗?一个接受TYPE_通知,另一个接受样式,对吗?它不起作用,