Push 전송 후 상단바에 알림을 클릭하면 해당 액티비티로 이동하는 것은 되는데 이게 앱을 켜고
홈키를 누른 후 백그라운드에 놓아야 실행이 되고 앱을 끈 상태로 Push 알림을 클릭하면
오류가 나면서 앱이 죽어버립니다. 지금 구상하고 있는 로직이 위와 같이 앱이 켜져 있다면
해당 액티비로 이동하고, 종료되어있다면 로그인창으로 가서 로그인 후 해당 액티비티로 이동하는 것인데
어찌해야 될까요... 그리고 해당 액티비티 이동 후에 뒤로가기 키를 누르면 종료 되지 않고 그 아래에 있던
액티비티가 실행 후 그 상태에서 꺼야되는 거 같습니다. 방법을 알려주세요 ㅠㅠ..
public class GCMIntentService extends GCMBaseIntentService
{
@Override
protected void onError(Context context, String errorId)
{
}
@SuppressWarnings("deprecation")
@Override
protected void onMessage(Context context, Intent intent)
{
String msg = intent.getStringExtra("msg");
String title = intent.getStringExtra("title");
String tickerText = "새로운 공지사항이 있습니다.";
NotificationManager notificationManager = (NotificationManager)context.getSystemService(Activity.NOTIFICATION_SERVICE);
PendingIntent pendingIntent = PendingIntent.getActivity(GCMIntentService.this, 0, new Intent(GCMIntentService.this, EtcBoard.class), 0);
Notification notification = new Notification();
WakeLock.acquireCpuWakeLock(this);
notification.icon = R.drawable.app_icon_60;
notification.tickerText = tickerText;
notification.when = System.currentTimeMillis();
notification.vibrate = new long[] { 500, 100, 500, 100 };
notification.sound = Uri.parse("file:///android_asset/typing.wav");
notification.flags = Notification.FLAG_AUTO_CANCEL;
notification.setLatestEventInfo(GCMIntentService.this, title, msg, pendingIntent);
notificationManager.notify(0, notification);
WakeLock.releaseCpuLock();
}