这是我在 android 上Notification
启动时的方法:Service
private void showNotification() {
Notification notification = new Notification(R.drawable.call, "Some text", System.currentTimeMillis());
Intent intent = new Intent(this, MainActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
PendingIntent pi = PendingIntent.getActivity(this, 0, intent, 0);
notification.setLatestEventInfo(this, getString(R.string.notification_label), getString(R.string.notification_text_short), pi);
notification.flags |= Notification.FLAG_NO_CLEAR;
startForeground(7331, notification);
}
以后可以改文字吗。现在是例如"Some text"
,以后我想更改它而无需停止并再次启动服务。
那可能吗?