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

Notification 클릭시 액티비티가 실행되지 않습니다.

0 추천

onPause 시 Notification 을 세팅하고, onResume 시 사라지게는 했습니다.

그런데 Notification 을 클릭해도, 설정한 activity 가 실행되지 않고 있습니다.

Notification 설정하는 부분 입니다.

public void showNotification()
{
        NotificationManager mNotiManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);

        
        Intent intent = new Intent(this, MainMenuActivity.class);
        intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
        PendingIntent pi = PendingIntent.getBroadcast(this, 0, intent, 0);
        
        Notification.Builder builder = new Notification.Builder(this);
        builder.setSmallIcon(R.drawable.icon_noti).setTicker("APP").setWhen(System.currentTimeMillis());
        builder.setContentText("APP is running");
        builder.setContentTitle("APP");
        builder.setContentIntent(pi);
        
        Notification notification = builder.getNotification();
        mNotiManager.notify(NOTI_ID, notification);
}

아래는 Notification 클릭 시Warning 로그 메시지 입니다.

W/KeyguardViewMediator(389): verifyUnlock called when not externally disabled
W/InputMethodManagerService(389): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@42ffbe30 attribute=null, token = android.os.BinderProxy@435b93a0

답변 부탁 드립니다.

감사합니다.

허저업 (670 포인트) 님이 2013년 5월 2일 질문

6개의 답변

0 추천
 
채택된 답변

자답입니다.

PendingIntent pi = PendingIntent.getBroadcast(this, 0, intent, 0);

이 부분을

PendingIntent pi = PendingIntent.getActivity(this, 0, intent, 0);

이렇게 수정했더니 실행이 되었습니다.

허저업 (670 포인트) 님이 2013년 5월 2일 답변
–1 추천
CoinJoin is a quintessence of anonymous affair that helps Bitcoin users maintain their privacy while sending Bitcoin. CoinJoin is a multiparty "Bitcoin mixing" transaction at the end of which it is unclear who owns which coin.
Upon the following transactions мейд at the same metre: A purchases an component from B, C purchases an matter from D, and E purchases an item from F. Without CoinJoin, the worldwide blockchain ledger would list three break to pieces transactions by reason of each input-output match.
With CoinJoin, exclusively [url=https://bitcoin-mixer.reviews]bitcoin mixer[/url] lone put goings-on is recorded. The ledger would guide that Bitcoins were paid from A, C, and E addresses to B, D, and F. On masking the deals мейд on all parties, an observer cannot with full confidence terminate who sent Bitcoins to whom.
While some in that CoinJoin is a new technology, this is not valid. CoinJoin is purely an advancement on already existing technology – Bitcoin. And Bitcoin mixers create CoinJoin technology to users.
EdwinPaW 님이 7월 25일 답변
–1 추천
Get Your Bali Villa Now - Don’t Wait Any Longer
Bali_qyer 님이 9월 4일 답변 1 신고
–1 추천
Лучшее решение для вашего дома – пластиковые окна
Plastikovy_erkr 님이 9월 7일 답변 1 신고
–1 추천
Скачать Винлайн — бесплатно и быстро
skachat_gzEl 님이 9월 13일 답변 1 신고
–1 추천
Search for Your Dream Bali Villa – Find Out What’s Available Now
Bali_vrsr 님이 11월 11일 답변
...