サービスのカスタム通知値の更新に問題があります。私はRemoteViewを使用していて、毎秒テキストビューを更新したいと思っていますが、これを行うための真のアイデアはありません. それは私のコードです:
int icon = R.drawable.ic_launcher;
long when = System.currentTimeMillis();
Notification notification = new Notification(icon, "Custom Notification", when);
NotificationManager mNotificationManager = (NotificationManager)getSystemService(NOTIFICATION_SERVICE);
contentView = new RemoteViews(getPackageName(), R.layout.notificationview);
contentView.setImageViewResource(R.id.image, R.drawable.ic_launcher);
contentView.setTextViewText(R.id.text, "This is a custom layout");
contentView.setTextViewText(R.id.title, "Title");
notification.contentView = contentView;
Intent notificationIntent = new Intent(this, MainActivity.class);
PendingIntent contentIntent = PendingIntent.getActivity(this, 0, notificationIntent, 0);
notification.contentIntent = contentIntent;
notification.flags |= Notification.FLAG_NO_CLEAR;
startForeground(13, notification);
何か案が ?