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