目的:通知はクリックすると自動的にキャンセルされ、アクティビティ(保留中の意図)を開く必要があります。
Nokia-X を期待する Android デバイスで完璧に動作する実行中のコードがあります。コードは次のとおりです。
Notification notification = new NotificationCompat.Builder(MainActivity.this)
.setContentTitle(MainActivity.this.getString(R.string.app_name))
.setContentText("text").setContentInfo("info").setTicker("Ticker text")
.setContentIntent(contentIntent).setSmallIcon(R.drawable.ic_launcher).setWhen(System.currentTimeMillis())
.setLights(Color.YELLOW, 1, 2).setAutoCancel(true).build();
NotificationManager nm = (NotificationManager)MainActivity.this.getSystemService(Context.NOTIFICATION_SERVICE);
nm.notify(1, notification);
Nokia-xデバイスの場合、通知を送信します。通知をクリックするとアクティビティが開きますが、通知は通知トレイに残ります。クリックしてもはっきりしません。
私を助けてください!!