小编Joh*_*esh的帖子

单击通知时如何打开活动

我需要使用带有单击事件的通知,我有通知方法,但此方法不会打开我的活动。

我的代码:

 private void sendNotification(String msg) {

        NotificationCompat.Builder mBuilder =  new NotificationCompat.Builder(this)
        .setContentTitle("EXX")
        .setSmallIcon(R.drawable.ic_launcher)
        .setStyle(new NotificationCompat.BigTextStyle()
        .bigText(msg))
        .setContentText(msg)          
        .setOngoing(true);          
    mNotificationManager.notify(NOTIFICATION_ID, mBuilder.build());
}    
Run Code Online (Sandbox Code Playgroud)

这可能吗,

谢谢。

java android android-notifications android-notification-bar

5
推荐指数
2
解决办法
1万
查看次数