0
8個のバージョンの次のコードを試しましたが、通知をクリックしたときにホームアクティビティが起動していません。ここで通知のクリック後にアクティビティが起動していません。
は、コードが
NotificationCompat.Builder builder = new NotificationCompat.Builder(getApplicationContext());
builder.setSmallIcon(R.mipmap.alert);
builder.setContentTitle("");
builder.setContentText("Running in Background");
builder.setOngoing(true);
IntenIntenticationIntent = new Intent(getApplicationContext(), Home.class);
PendingIntent contentIntent = PendingIntent.getActivity(getApplicationContext(), 0,notificationIntent, 0);
notificationManager = (NotificationManager) getApplicationContext().getSystemService(getApplicationContext().NOTIFICATION_SERVICE);
notificationManager.notify(NOTIFICATION_ID, builder.build());
あなたは素晴らしいです!私はこれを働かせるために数時間努力してきました。私はそれが私が行方不明だったsetContentIntentだと思います。 – Movieboy