GCM메세지를 받아서 noti 해줄때 각각의 ID를 달리해서 받고 있습니다.

(여러개의 알림을 받기 위함입니다)


알림창에 각각의 메세지가 쭉 리스팅 되면서 받아지고 있습니다.


문제는 맨 위에 있는 알림을 터치해도 가장 최근에 받아진 메세지에 해당하는 내용이 보여지고 있습니다.


[5번 메세지] activit1으로 이동(extra A에 1)

[4번 메세지] activit1으로 이동(extra A에 7)

[3번 메세지] activit2으로 이동(extra B에 21)

[2번 메세지] activit2으로 이동(extra B에 21)

[1번 메세지] activit1으로 이동(extra A에 21)


이동하는 액티비티는 리턴되어 오는 값에 따라서 두개의 액티비티로 분기 됩니다.


각각의 메세지마다 다른 액티비티로 이동하게 하고 싶은데 불가능 한가요?


if(sendType.equals("액티비티1")){

변수1값 = intent.getExtras().getString("변수1");

변수2값 = intent.getExtras().getString("변수2");

변수3값 = intent.getExtras().getString("변수3");

변수4값 = intent.getExtras().getString("변수4");

변수5값 = intent.getExtras().getString("변수5");

}else if(sendType.equals("액티비티2")){

변수6값 = intent.getExtras().getString("변수6");

변수7값 = intent.getExtras().getString("변수7");

변수8값 = intent.getExtras().getString("변수8");

}


if(sendType.equals("액티비티1")){

PendingIntent contentIntet = PendingIntent.getActivity(context, 0, 

new Intent(context, 액티비티1.class)

.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP)

.putExtra("변수1",변수1값);

.putExtra("변수2",변수2값);

.putExtra("변수3",변수3값);

.putExtra("변수4",변수4값);

.putExtra("변수5",변수5값);

PendingIntent.FLAG_UPDATE_CURRENT);

notification.setLastestEventInfo(context, 제목, 내용, contentIntent);

notification.notify("노티ID",notification");

}else if(sendType.equals("액티비티2")){

PendingIntent contentIntet = PendingIntent.getActivity(context, 0, 

new Intent(context, 액티비티2.class)

.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP)

.putExtra("변수6",변수1값);

.putExtra("변수7",변수2값);

.putExtra("변수8",변수3값);

PendingIntent.FLAG_UPDATE_CURRENT);

notification.setLastestEventInfo(context, 제목, 내용, contentIntent);

notification.notify("노티ID",notification");

}


대략적인 코드입니다.