Android:停止声音通知
问题描述:
我使用NotificationManager播放声音。但是当我按任意键时,我不知道如何阻止它。例如,后退按钮。非常感谢~~~ ^^Android:停止声音通知
NotificationManager manager
= (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
Notification notification = new Notification();
notification.sound=Uri.parse("android.resource://"
+ getPackageName() + "/" +R.raw.fin);
manager.notify(1, notification);
答
我相信NotificationManager使用MediaPlayer播放声音。 这默认播放你的整个声音。 所以你需要打电话给mediaplayer.stop。 您是否试过取消您的通知? notification Cancel
恩......是的,我只是想阻止它......或者退出此通知。 无论如何,谢谢你的回复。 –