5
getIntent()附加内容始终为NULL
我写了一个简单的Android应用,它显示了这样的自定义通知: Context context = getApplicationContext(); NotificationManager manager = (NotificationManager)getSystemService(NOTIFICATION_SERVICE); Notification notification = new Notification( R.drawable.icon, title, System.currentTimeMillis()); Intent notificationIntent = new Intent( context, this.getClass()); notificationIntent.putExtra("com.mysecure.lastpage", "SECURECODE"); PendingIntent pendingIntent = PendingIntent.getActivity( context , 0, notificationIntent, 0); notification.flags = notification.flags | Notification.FLAG_ONGOING_EVENT; notification.contentView = new RemoteViews(context.getPackageName(), R.layout.notifypbar); notification.contentIntent = pendingIntent; notification.contentView.setTextViewText(R.id.notifypb_status_text, text); …