2014-12-03 2 views
0

Android 상태 표시 줄에 아이콘을 생성하는 아래 코드가 있습니다.안드로이드 상태 표시 줄의 아이콘 수정 방법

Context context = getApplicationContext(); 
NotificationCompat.Builder builder = new NotificationCompat.Builder(this) 
    .setSmallIcon(R.drawable.ic_launcher) 
    .setContentTitle(getString(R.string.app_name)) 
    .setContentText("Live Tracking"); 

Intent intent = new Intent(context, MainActivity.class); 
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); 
intent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT); 
PendingIntent pIntent = PendingIntent.getActivity(context, mID , intent, 0); 
builder.setContentIntent(pIntent); 
mNotificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); 

Notification notif = builder.build(); 
mNotificationManager.notify(mID, notif); 

사용자가 "모든 알림 삭제"버튼을 누르면 아이콘이 제거되는 것을 방지 할 수있는 방법이 있습니까?

많은 도움에 감사드립니다. 안부 인사, 빈센트.

답변

1

알림 빌더에 setOngoing(true)을 추가하십시오. 알림을 유지하므로 직접 제거해야합니다.

+0

대단히 감사합니다 !! – Vincent

관련 문제