내 앱에서 안드로이드에 이상한 문제가 있습니다. 알림을 완료했으며 알림을 클릭하면 새로운 활동을 시작하려고합니다. 문제는 알림을 클릭해도 아무 일도 일어나지 않고 문제가 어디인지 전혀 알지 못한다는 것입니다. ? 의견에서와 같이알림을 클릭 할 때 활동을 시작하는 방법은 무엇입니까?
notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
CharSequence NotificationTicket = "Notification";
CharSequence NotificationTitle = "Notification";
CharSequence NotificationContent = "Test";
long when = System.currentTimeMillis();
Notification notification = new Notification(R.drawable.icon,
NotificationTicket, when);
Context context = getApplicationContext();
Intent notificationIntent = new Intent(this, ShopsOnMap.class);
PendingIntent contentIntent = PendingIntent.getActivity(this, 0,
notificationIntent, 0);
notification.setLatestEventInfo(context, NotificationTitle, NotificationContent, contentIntent);
notificationManager.notify(NOTIFICATION_ID, notification);
notificationIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP| Intent.FLAG_ACTIVITY_SINGLE_TOP);
팁 : 상단에 버튼이있는 막대는 코드를 쉽게 포맷 할 수있게 해줍니다 (예 : '{}'버튼 사용). – Nanne
문제가 없는지, ShopsOnMap 활동의 oncreate에'Log.d' 디버깅 코드를 추가하여 문제가 있는지 확인할 수 있습니다. – Nanne
당신이 말하고자하는 바를 이해할 수 없습니다. 좀 더 명확하게 표현할 수 있습니까? 아니면 LogCat에 – Gaby