Tag: android notification

通知通过旧的意图附加

我正在通过这个代码在BroadcastReceiver中创build一个通知: String ns = Context.NOTIFICATION_SERVICE; NotificationManager mNotificationManager = (NotificationManager) context.getSystemService(ns); int icon = R.drawable.ic_stat_notification; CharSequence tickerText = "New Notification"; long when = System.currentTimeMillis(); Notification notification = new Notification(icon, tickerText, when); notification.defaults |= Notification.DEFAULT_VIBRATE; long[] vibrate = {0,100,200,200,200,200}; notification.vibrate = vibrate; notification.flags |= Notification.FLAG_AUTO_CANCEL; CharSequence contentTitle = "Title"; CharSequence contentText = "Text"; Intent notificationIntent = new […]