更新通知tickerText

时间:2014-10-05 12:18:32

标签: android

我在后台服务中创建了一个通知

notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
        final Intent i = new Intent(this, MapsActivity.class);
        i.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
        final PendingIntent pending = PendingIntent.getActivity(this, 0, i, PendingIntent.FLAG_UPDATE_CURRENT);
        final Notification notification = new Notification.Builder(this)
                .setVibrate(new long[] { 1000, 1000, 1000, 1000, 1000 })
                .setTicker("text")
                .setContentTitle("text")
                .setContentText("text")
                .setSmallIcon(R.drawable.ic_launcher)
                .setContentIntent(pending)
                .setWhen(when)
                .setAutoCancel(true).build();
        notification.flags |= Notification.FLAG_AUTO_CANCEL;
        notificationManager.notify(1000, notification);
        startForeground(1000, notification);

做完之后我想更新 我现有通知的tickerText,contentTitle和contentText 。有可能吗?

0 个答案:

没有答案