마스터Q&A 안드로이드는 안드로이드 개발자들의 질문과 답변을 위한 지식 커뮤니티 사이트입니다. 안드로이드펍에서 운영하고 있습니다. [사용법, 운영진]

GCM notification 이랑 팝업이 따로 오네요 ;

0 추천
안녕하세요 ^^

 Gcm 노티랑 팝업알람을 받기에 성공은했는데 아무리 수정해도 따로오네요; 팝업창은  거의 제가 원격으로(php) 실행하자마자 바로 오는데 노티는 한 10초? 정도 뒤에 옵니다; 둘다 리시버에 집어넣은상태인데; 어떻게 해야지 같이오나요?ㅠㅠ

Intent intent_ = new Intent(context, PopupActivity.class);
intent_.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_SINGLE_TOP);   //이거안해주면안됨

context.startActivity(intent_);

이게 리시버에 들어있는 푸시 팝업 실행인데 이걸 GcmIntentService에 집어 넣을수도 없지 않나요??

public class GcmBroadcastReceiver extends WakefulBroadcastReceiver {

   

    @Override
    public void onReceive(Context context, Intent intent) {

    

        // Explicitly specify that GcmIntentService will handle the intent.
        ComponentName comp = new ComponentName(context.getPackageName(),
                GcmIntentService.class.getName());
        // Start the service, keeping the device awake while it is launching.
        startWakefulService(context, (intent.setComponent(comp)));
        
        setResultCode(Activity.RESULT_OK);

 

 

        

            Intent intent_ = new Intent(context, PopupActivity.class);
            intent_.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_SINGLE_TOP);   //이거안해주면안됨

            context.startActivity(intent_);
        
    
}}

리시버 전체 코드입니다

고수님들 알려주세요~ ㅠㅠ
껄껄앱 (1,910 포인트) 님이 2016년 2월 28일 질문

답변 달기

· 글에 소스 코드 보기 좋게 넣는 법
· 질문에 대해 추가적인 질문이나 의견이 있으면 답변이 아니라 댓글로 달아주시기 바랍니다.
표시할 이름 (옵션):
개인정보: 당신의 이메일은 이 알림을 보내는데만 사용됩니다.
스팸 차단 검사:
스팸 검사를 다시 받지 않으려면 로그인하거나 혹은 가입 하세요.
...