如何停止通知启动的声音?

时间:2017-09-03 14:46:32

标签: android notifications

我想使用TYPE_RINGTONE,但如果该歌曲很长,我想用一个按钮停止它。我怎么能这样做?感谢。

NotificationCompat.Builder builder = new NotificationCompat.Builder(this); builder.setContentTitle(getString(R.string.app_name)); builder.setTicker(getString(R.string.notification_text)); builder.setContentText(getString(R.string.notification_text)); builder.setSmallIcon(R.drawable.ic_monocromogordo); builder.setSound(RingtoneManager.getDefaultUri(RingtoneManager.TYPE_RINGTONE)); builder.build();

0 个答案:

没有答案