0

GCM을 통합하려는 작은 Android 응용 프로그램을 개발 중입니다. 나는 그것을 위해 하나의 모듈을 사용하고 잘 동작한다. 그것의 유일한 문제는 내 응용 프로그램이 열려있을 때 나는 내가 원하지 않는 내 응용 프로그램을 재발행하는 알림을 클릭하는 경우입니다. 응용 프로그램이 이미 실행중인 경우 원하는 것만 실행중인 창을 표시하고 응용 프로그램을 닫은 다음 응용 프로그램을 실행하면 원하는 것입니다. 내 모듈은 응용 프로그램이 닫혀있는 경우 잘 작동 .. 그러나 이미 예상되지 않는 실행중인 응용 프로그램을 다시 시작한다 Gcm 또는 C2DM 응용 프로그램 실행 문제 (티타늄 android)

int icon = 0x7f020000; 

    CharSequence tickerText = new String("app anme: " + hashdata.get("messages")); 
    long when = System.currentTimeMillis(); 

    CharSequence contentTitle = "app name"; 
    CharSequence contentText = new String(" " + hashdata.get("messages")); 

    Intent notificationIntent = new Intent(this, GCMIntentService.class); 

    Intent launcherintent = new Intent("android.intent.action.MAIN"); 
    launcherintent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_CLEAR_TOP); 

    launcherintent.setComponent(ComponentName.unflattenFromString("com.example/com.example.ExampleActivity")); 
    launcherintent.addCategory("android.intent.category.LAUNCHER"); 

    PendingIntent contentIntent = PendingIntent.getActivity(this, 0, launcherintent, 0); 

    Notification notification = new Notification(icon, tickerText, when); 

    notification.defaults = Notification.DEFAULT_ALL; 
    notification.flags = Notification.FLAG_AUTO_CANCEL; 
    notification.setLatestEventInfo(context, contentTitle, contentText,contentIntent); 
    String ns = Context.NOTIFICATION_SERVICE; 
    NotificationManager mNotificationManager = (NotificationManager) getSystemService(ns); 
    mNotificationManager.notify(1, notification); 

처럼 ...의 onMessage 내 모듈 코드에서 수신 보이는 ...... 도움이 필요하십니까 ..... 고맙습니다 ...........

답변