내 목표는 사용자가 알림을 클릭하면 마지막 활동으로 돌아가는 것입니다. 나는 이런 식의 서비스에서 onCreate()에서에서 알림을 생성합니다Android : 알림에서 마지막 활동 복원
Intent notificationIntent = new Intent(this, MainActivity.class);
notificationIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
PendingIntent contentIntent = PendingIntent.getActivity(this, 0, notificationIntent, 0);
하지만 알림을 클릭하면이 홈 버튼을 클릭하기 전에 열린 마지막에 MainActivity로 이동하지.
manifest에서 launchMode = "singleTop", "standard"및 "singletask"로 MainActivity를 시도했지만 성공하지 못했습니다.
감사합니다.
여기에서 가장 좋은 해결책은 http://stackoverflow.com/questions/31448840/android-how-to-open-last-activity-when-tapping-notification – nAkhmedov