单击ExoPlayer通知以打开应用

时间:2018-06-26 08:33:02

标签: exoplayer

使用ExoPlayer和PlayerNotificationManager在通知中显示媒体播放进度,现在如何单击通知打开应用程序?

1 个答案:

答案 0 :(得分:0)

当您尝试通过PlayerNotificationManager创建NotificationChannel时,直接在MediaDescriptor下覆盖此方法

@Override

 public PendingIntent createCurrentContentIntent(Player player){
     Intent intent = new Intent(YourService.this,YourMediaActivity.class);
                       PendingIntent contentPendingIntent = PendingIntent.getActivity
                                (YourService.this, 0, intent, 0);
                        return contentPendingIntent;
                    }