我只想访问点击操作中写在附加选项内的那些自定义数据
private void showNotification(String title, String message,String category,String index) {
Intent intent=new Intent(getApplicationContext(),MyActivity.class);break;
PendingIntent contentIntent = PendingIntent.getActivity(getApplicationContext(),0,intent,PendingIntent.FLAG_UPDATE_CURRENT);
NotificationCompat.Builder b = new NotificationCompat.Builder(getApplicationContext());
b.setAutoCancel(true)
.setDefaults(Notification.DEFAULT_ALL)
.setWhen(System.currentTimeMillis())
.setSmallIcon(R.mipmap.ic_launcher)
.setContentTitle(title)
.setContentText(message)
.setContentIntent(contentIntent);
NotificationManager notificationManager = (NotificationManager)getBaseContext().getSystemService(Context.NOTIFICATION_SERVICE);
notificationManager.notify(1,b.build());
}
答案 0 :(得分:0)
如果其他人遇到相同的问题,我可以自己解决此问题,您可以使用此功能
.getData();