List of usage examples for android.app Notification DEFAULT_ALL
int DEFAULT_ALL
To view the source code for android.app Notification DEFAULT_ALL.
Click Source Link
From source file:org.kde.kdeconnect.Plugins.SharePlugin.SharePlugin.java
@Override public boolean onPackageReceived(NetworkPackage np) { try {/*from ww w .j ava 2 s . co m*/ if (np.hasPayload()) { Log.i("SharePlugin", "hasPayload"); final InputStream input = np.getPayload(); final long fileLength = np.getPayloadSize(); final String originalFilename = np.getString("filename", Long.toString(System.currentTimeMillis())); //We need to check for already existing files only when storing in the default path. //User-defined paths use the new Storage Access Framework that already handles this. final boolean customDestination = ShareSettingsActivity.isCustomDestinationEnabled(context); final String defaultPath = ShareSettingsActivity.getDefaultDestinationDirectory().getAbsolutePath(); final String filename = customDestination ? originalFilename : FilesHelper.findNonExistingNameForNewFile(defaultPath, originalFilename); String displayName = FilesHelper.getFileNameWithoutExt(filename); final String mimeType = FilesHelper.getMimeTypeFromFile(filename); if ("*/*".equals(mimeType)) { displayName = filename; } final DocumentFile destinationFolderDocument = ShareSettingsActivity .getDestinationDirectory(context); final DocumentFile destinationDocument = destinationFolderDocument.createFile(mimeType, displayName); final OutputStream destinationOutput = context.getContentResolver() .openOutputStream(destinationDocument.getUri()); final Uri destinationUri = destinationDocument.getUri(); final int notificationId = (int) System.currentTimeMillis(); Resources res = context.getResources(); final NotificationCompat.Builder builder = new NotificationCompat.Builder(context) .setContentTitle(res.getString(R.string.incoming_file_title, device.getName())) .setContentText(res.getString(R.string.incoming_file_text, filename)) .setTicker(res.getString(R.string.incoming_file_title, device.getName())) .setSmallIcon(android.R.drawable.stat_sys_download).setAutoCancel(true).setOngoing(true) .setProgress(100, 0, true); final NotificationManager notificationManager = (NotificationManager) context .getSystemService(Context.NOTIFICATION_SERVICE); NotificationHelper.notifyCompat(notificationManager, notificationId, builder.build()); new Thread(new Runnable() { @Override public void run() { boolean successful = true; try { byte data[] = new byte[1024]; long progress = 0, prevProgressPercentage = 0; int count; while ((count = input.read(data)) >= 0) { progress += count; destinationOutput.write(data, 0, count); if (fileLength > 0) { if (progress >= fileLength) break; long progressPercentage = (progress * 100 / fileLength); if (progressPercentage != prevProgressPercentage) { prevProgressPercentage = progressPercentage; builder.setProgress(100, (int) progressPercentage, false); NotificationHelper.notifyCompat(notificationManager, notificationId, builder.build()); } } //else Log.e("SharePlugin", "Infinite loop? :D"); } destinationOutput.flush(); } catch (Exception e) { successful = false; Log.e("SharePlugin", "Receiver thread exception"); e.printStackTrace(); } finally { try { destinationOutput.close(); } catch (Exception e) { } try { input.close(); } catch (Exception e) { } } try { Log.i("SharePlugin", "Transfer finished: " + destinationUri.getPath()); //Update the notification and allow to open the file from it Resources res = context.getResources(); String message = successful ? res.getString(R.string.received_file_title, device.getName()) : res.getString(R.string.received_file_fail_title, device.getName()); NotificationCompat.Builder builder = new NotificationCompat.Builder(context) .setContentTitle(message).setTicker(message) .setSmallIcon(android.R.drawable.stat_sys_download_done).setAutoCancel(true); if (successful) { Intent intent = new Intent(Intent.ACTION_VIEW); intent.setDataAndType(destinationUri, mimeType); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); TaskStackBuilder stackBuilder = TaskStackBuilder.create(context); stackBuilder.addNextIntent(intent); PendingIntent resultPendingIntent = stackBuilder.getPendingIntent(0, PendingIntent.FLAG_UPDATE_CURRENT); builder.setContentText( res.getString(R.string.received_file_text, destinationDocument.getName())) .setContentIntent(resultPendingIntent); } SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); if (prefs.getBoolean("share_notification_preference", true)) { builder.setDefaults(Notification.DEFAULT_ALL); } NotificationHelper.notifyCompat(notificationManager, notificationId, builder.build()); if (successful) { if (!customDestination && Build.VERSION.SDK_INT >= 12) { Log.i("SharePlugin", "Adding to downloads"); DownloadManager manager = (DownloadManager) context .getSystemService(Context.DOWNLOAD_SERVICE); manager.addCompletedDownload(destinationUri.getLastPathSegment(), device.getName(), true, mimeType, destinationUri.getPath(), fileLength, false); } else { //Make sure it is added to the Android Gallery anyway MediaStoreHelper.indexFile(context, destinationUri); } } } catch (Exception e) { Log.e("SharePlugin", "Receiver thread exception"); e.printStackTrace(); } } }).start(); } else if (np.has("text")) { Log.i("SharePlugin", "hasText"); String text = np.getString("text"); if (Build.VERSION.SDK_INT >= 11) { ClipboardManager cm = (ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE); cm.setText(text); } else { android.text.ClipboardManager clipboard = (android.text.ClipboardManager) context .getSystemService(Context.CLIPBOARD_SERVICE); clipboard.setText(text); } Toast.makeText(context, R.string.shareplugin_text_saved, Toast.LENGTH_LONG).show(); } else if (np.has("url")) { String url = np.getString("url"); Log.i("SharePlugin", "hasUrl: " + url); Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(url)); browserIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); if (openUrlsDirectly) { context.startActivity(browserIntent); } else { Resources res = context.getResources(); TaskStackBuilder stackBuilder = TaskStackBuilder.create(context); stackBuilder.addNextIntent(browserIntent); PendingIntent resultPendingIntent = stackBuilder.getPendingIntent(0, PendingIntent.FLAG_UPDATE_CURRENT); Notification noti = new NotificationCompat.Builder(context) .setContentTitle(res.getString(R.string.received_url_title, device.getName())) .setContentText(res.getString(R.string.received_url_text, url)) .setContentIntent(resultPendingIntent) .setTicker(res.getString(R.string.received_url_title, device.getName())) .setSmallIcon(R.drawable.ic_notification).setAutoCancel(true) .setDefaults(Notification.DEFAULT_ALL).build(); NotificationManager notificationManager = (NotificationManager) context .getSystemService(Context.NOTIFICATION_SERVICE); NotificationHelper.notifyCompat(notificationManager, (int) System.currentTimeMillis(), noti); } } else { Log.e("SharePlugin", "Error: Nothing attached!"); } } catch (Exception e) { Log.e("SharePlugin", "Exception"); e.printStackTrace(); } return true; }
From source file:com.teinproductions.tein.papyrosprogress.UpdateCheckReceiver.java
private static void issueBlogNotification(Context context) { String title = context.getString(R.string.notification_title); String message = context.getString(R.string.blog_notification_content); PendingIntent pendingIntent;/*from w w w . j a v a 2 s . c o m*/ try { pendingIntent = PendingIntent.getActivity(context, 0, new Intent(Intent.ACTION_VIEW, Uri.parse(Constants.PAPYROS_BLOG_URL)), PendingIntent.FLAG_UPDATE_CURRENT); } catch (Exception e) { e.printStackTrace(); return; } NotificationCompat.Builder builder = new NotificationCompat.Builder(context).setContentTitle(title) .setContentText(message).setContentIntent(pendingIntent) .setSmallIcon(R.mipmap.notification_small_icon) .setLargeIcon(BitmapFactory.decodeResource(context.getResources(), R.mipmap.ic_launcher)) .setDefaults(Notification.DEFAULT_ALL).setAutoCancel(true); NotificationManager notificationManager = (NotificationManager) context .getSystemService(Context.NOTIFICATION_SERVICE); notificationManager.notify(BLOG_NOTIFICATION_ID, builder.build()); }
From source file:com.mobileman.moments.android.frontend.activity.IncomingCallActivity.java
private void sendNotificationAndFinish() { if (streamingUser != null) { Intent intent = new Intent(getApplicationContext(), MediaPlayerActivity.class); Bundle extras = new Bundle(); extras.putString(MediaPlayerActivity.MEDIA_URL, streamingUser.getStream().getFullVideoUrl()); extras.putString(MediaPlayerActivity.THUMBNAIL_URL, streamingUser.getStream().getFullThumbnailUrl()); extras.putString(MediaPlayerActivity.USER_ID, streamingUser.getUuid()); intent.putExtras(extras);//ww w . ja va 2s. c o m intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NO_HISTORY | Intent.FLAG_ACTIVITY_SINGLE_TOP); PendingIntent contentIntent = PendingIntent.getActivity(getApplicationContext(), 0, intent, PendingIntent.FLAG_UPDATE_CURRENT); NotificationCompat.Builder b = new NotificationCompat.Builder(getApplicationContext()); String notificationTitle = userName + " " + getResources().getString(R.string.isLiveSuffix); String notificationText = "";// getResources().getString(R.string.missedCallNotification) + " " + streamingUser.getName(); String mediaUrl = streamingUser.getStream().getFullVideoUrl(); if ((streamingUser.getStream() != null) && (streamingUser.getStream().getTitle() != null)) { notificationText = streamingUser.getStream().getTitle(); //notificationText + "(" + streamingUser.getStream().getTitle() + ")"; } ImageView incomingCallUserImageView = (ImageView) findViewById(R.id.incomingCallUserImageView); Bitmap bitmap = ((BitmapDrawable) incomingCallUserImageView.getDrawable()).getBitmap(); NotificationCompat.BigTextStyle bigTextStyle = new NotificationCompat.BigTextStyle(); b.setAutoCancel(true).setSmallIcon(R.drawable.ic_launcher).setDefaults(Notification.DEFAULT_ALL) .setWhen(System.currentTimeMillis()).setTicker("X").setContentTitle(notificationTitle) .setContentText(notificationText) .setDefaults(Notification.DEFAULT_LIGHTS | Notification.DEFAULT_SOUND) .setContentIntent(contentIntent); // if (bitmap != null) { // b.setLargeIcon(bitmap); // } NotificationManager notificationManager = (NotificationManager) getApplicationContext() .getSystemService(Context.NOTIFICATION_SERVICE); notificationManager.notify(++NOTIFICATION_COUNTER, b.build()); } finish(); }
From source file:com.artech.android.gcm.GcmIntentService.java
@SuppressLint("InlinedApi") public void createNotification(String payload, String action, String notificationParameters) { NotificationManager notificationManager = (NotificationManager) getSystemService( Context.NOTIFICATION_SERVICE); String appName = getString(R.string.app_name); SharedPreferences settings = MyApplication.getInstance().getAppSharedPreferences(); int notificatonID = settings.getInt("notificationID", 0); // allow multiple notifications //$NON-NLS-1$ Intent intent = new Intent("android.intent.action.MAIN"); //$NON-NLS-1$ intent.setClassName(this, getPackageName() + ".Main"); //$NON-NLS-1$ intent.addCategory("android.intent.category.LAUNCHER"); //$NON-NLS-1$ if (Services.Strings.hasValue(action)) { // call main as root of the stack with the action as intent parameter. Use clear_task like GoHome if (CompatibilityHelper.isApiLevel(Build.VERSION_CODES.HONEYCOMB)) intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK); else// w w w . j a v a2 s . c o m intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK); intent.putExtra(IntentParameters.NotificationAction, action); intent.putExtra(IntentParameters.NotificationParameters, notificationParameters); intent.setAction(String.valueOf(Math.random())); } else { // call main like main application shortcut intent.setFlags(0); intent.setAction("android.intent.action.MAIN"); } PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT); Notification notification = NotificationHelper.newBuilder(this).setWhen(System.currentTimeMillis()) .setContentTitle(appName).setContentText(payload).setContentIntent(pendingIntent) .setStyle(new NotificationCompat.BigTextStyle().bigText(payload)) .setDefaults(Notification.DEFAULT_ALL).setAutoCancel(true).build(); notificationManager.notify(notificatonID, notification); SharedPreferences.Editor editor = settings.edit(); editor.putInt("notificationID", ++notificatonID % 32); //$NON-NLS-1$ editor.commit(); }
From source file:de.unipassau.isl.evs.ssh.app.handler.AppNotificationHandler.java
/** * Builds the Notification with the given text and displays it on the user-device. * If user clicks on it, the ssh app will open. * * @param title for the Notification * @param text under the title to give further information * @param openThisFragment Which fragment should be opened when clicked on the notification * Add string to MainActivity (onCreate) if not already declared. * @param notificationID unique ID for this type of Notification *///from w w w. ja va 2s .c om private void displayNotification(String title, String text, Class openThisFragment, int notificationID) { //If Notification is clicked send to this Page Context context = requireComponent(ContainerService.KEY_CONTEXT); Intent resultIntent = new Intent(context, AppMainActivity.class); resultIntent.putExtra(AppMainActivity.KEY_NOTIFICATION_FRAGMENT, openThisFragment); TaskStackBuilder stackBuilder = TaskStackBuilder.create(context); stackBuilder.addParentStack(AppMainActivity.class); stackBuilder.addNextIntent(resultIntent); PendingIntent resultPendingIntent = stackBuilder.getPendingIntent(0, PendingIntent.FLAG_UPDATE_CURRENT); NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(context); notificationBuilder.setContentIntent(resultPendingIntent).setDefaults(Notification.DEFAULT_ALL) .setSmallIcon(R.drawable.ic_home_light).setWhen(System.currentTimeMillis()).setContentTitle(title) .setStyle(new NotificationCompat.BigTextStyle().bigText(text)) .setLights(R.color.colorPrimary, 3000, 3000); NotificationManager notificationManager = (NotificationManager) context .getSystemService(Context.NOTIFICATION_SERVICE); //Delete old BellRang if door gets unlocked if (notificationID == DOOR_UNLATCHED.ordinal()) { notificationManager.cancel(BELL_RANG.ordinal()); } //Delete old HolidayMode switched on notification if HolidayMode is switched off if (notificationID == HOLIDAY_MODE_SWITCHED_OFF.ordinal()) { notificationManager.cancel(HOLIDAY_MODE_SWITCHED_ON.ordinal()); } //^vis versa HolidayMode if (notificationID == HOLIDAY_MODE_SWITCHED_ON.ordinal()) { notificationManager.cancel(HOLIDAY_MODE_SWITCHED_OFF.ordinal()); } //Delete old door locked notification if door is unlocked if (notificationID == DOOR_UNLOCKED.ordinal()) { notificationManager.cancel(DOOR_LOCKED.ordinal()); } //^vis versa door notification if (notificationID == DOOR_LOCKED.ordinal()) { notificationManager.cancel(DOOR_UNLOCKED.ordinal()); } //Send notification out to Device if (notificationManager != null) { notificationManager.notify(notificationID, notificationBuilder.build()); } else { Log.e(TAG, "ERROR! context.getSystemService(Context.NOTIFICATION_SERVICE) was null (AppNotificationHandler)"); } }
From source file:org.chromium.chrome.browser.notifications.NotificationUIManager.java
/** * Generates the notfiication defaults from vibrationPattern's size and silent. * * Use the system's default ringtone, vibration and indicator lights unless the notification * has been marked as being silent.//from w w w .ja va2s. c o m * If a vibration pattern is set, the notification should use the provided pattern * rather than the defaulting to system settings. * * @param vibrationPatternLength Vibration pattern's size for the Notification. * @param silent Whether the default sound, vibration and lights should be suppressed. * @return The generated notification's default value. */ @VisibleForTesting static int makeDefaults(int vibrationPatternLength, boolean silent) { assert !silent || vibrationPatternLength == 0; if (silent) return 0; int defaults = Notification.DEFAULT_ALL; if (vibrationPatternLength > 0) { defaults &= ~Notification.DEFAULT_VIBRATE; } return defaults; }
From source file:com.csipsimple.service.SipNotifications.java
public void showNotificationForMissedCall(ContentValues callLog) { int icon = android.R.drawable.stat_notify_missed_call; CharSequence tickerText = context.getText(R.string.missed_call); long when = System.currentTimeMillis(); if (missedCallNotification == null) { missedCallNotification = new NotificationCompat.Builder(context); missedCallNotification.setSmallIcon(icon); missedCallNotification.setTicker(tickerText); missedCallNotification.setWhen(when); missedCallNotification.setOnlyAlertOnce(true); missedCallNotification.setAutoCancel(true); missedCallNotification.setDefaults(Notification.DEFAULT_ALL); }/*from ww w . j av a2 s . c o m*/ Intent notificationIntent = new Intent(SipManager.ACTION_SIP_CALLLOG); notificationIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); PendingIntent contentIntent = PendingIntent.getActivity(context, 0, notificationIntent, PendingIntent.FLAG_CANCEL_CURRENT); String remoteContact = callLog.getAsString(CallLog.Calls.NUMBER); long accId = callLog.getAsLong(SipManager.CALLLOG_PROFILE_ID_FIELD); missedCallNotification.setContentTitle(formatNotificationTitle(R.string.missed_call, accId)); missedCallNotification.setContentText(formatRemoteContactString(remoteContact)); missedCallNotification.setContentIntent(contentIntent); notificationManager.notify(CALLLOG_NOTIF_ID, missedCallNotification.build()); }
From source file:org.kde.kdeconnect.Device.java
public void displayPairingNotification() { hidePairingNotification();// ww w . j av a 2 s. c om notificationId = (int) System.currentTimeMillis(); Intent intent = new Intent(getContext(), MaterialActivity.class); intent.putExtra("deviceId", getDeviceId()); intent.putExtra("notificationId", notificationId); PendingIntent pendingIntent = PendingIntent.getActivity(getContext(), 0, intent, PendingIntent.FLAG_CANCEL_CURRENT); Intent acceptIntent = new Intent(getContext(), MaterialActivity.class); Intent rejectIntent = new Intent(getContext(), MaterialActivity.class); acceptIntent.putExtra("deviceId", getDeviceId()); acceptIntent.putExtra("notificationId", notificationId); acceptIntent.setAction("action " + System.currentTimeMillis()); acceptIntent.putExtra(MaterialActivity.PAIR_REQUEST_STATUS, MaterialActivity.PAIRING_ACCEPTED); rejectIntent.putExtra("deviceId", getDeviceId()); rejectIntent.putExtra("notificationId", notificationId); rejectIntent.setAction("action " + System.currentTimeMillis()); rejectIntent.putExtra(MaterialActivity.PAIR_REQUEST_STATUS, MaterialActivity.PAIRING_REJECTED); PendingIntent acceptedPendingIntent = PendingIntent.getActivity(getContext(), 2, acceptIntent, PendingIntent.FLAG_ONE_SHOT); PendingIntent rejectedPendingIntent = PendingIntent.getActivity(getContext(), 4, rejectIntent, PendingIntent.FLAG_ONE_SHOT); Resources res = getContext().getResources(); Notification noti = new NotificationCompat.Builder(getContext()) .setContentTitle(res.getString(R.string.pairing_request_from, getName())) .setContentText(res.getString(R.string.tap_to_answer)).setContentIntent(pendingIntent) .setTicker(res.getString(R.string.pair_requested)).setSmallIcon(R.drawable.ic_notification) .addAction(R.drawable.ic_accept_pairing, res.getString(R.string.pairing_accept), acceptedPendingIntent) .addAction(R.drawable.ic_reject_pairing, res.getString(R.string.pairing_reject), rejectedPendingIntent) .setAutoCancel(true).setDefaults(Notification.DEFAULT_ALL).build(); final NotificationManager notificationManager = (NotificationManager) getContext() .getSystemService(Context.NOTIFICATION_SERVICE); NotificationHelper.notifyCompat(notificationManager, notificationId, noti); BackgroundService.addGuiInUseCounter(context); }
From source file:org.dmfs.tasks.notification.NotificationUpdaterService.java
@TargetApi(Build.VERSION_CODES.JELLY_BEAN) private static Notification makePinNotification(Context context, Builder builder, ContentSet task, boolean withSound, boolean withTickerText, boolean withHeadsUpNotification) { Resources resources = context.getResources(); // reset actions builder.mActions = new ArrayList<Action>(2); // content//from w ww .j ava 2 s.com builder.setSmallIcon(R.drawable.ic_pin_white_24dp).setContentTitle(TaskFieldAdapters.TITLE.get(task)) .setOngoing(true).setShowWhen(false); // set priority for HeadsUpNotification if (VERSION.SDK_INT >= VERSION_CODES.JELLY_BEAN) { if (withHeadsUpNotification) { builder.setPriority(Notification.PRIORITY_HIGH); } else { builder.setPriority(Notification.PRIORITY_DEFAULT); } } // color is based on the priority of the task. If the task has no priority we use the primary color. Integer priority = TaskFieldAdapters.PRIORITY.get(task); if (priority != null && priority > 0) { if (priority < 5) { builder.setColor(resources.getColor(R.color.priority_red)); } if (priority == 5) { builder.setColor(resources.getColor(R.color.priority_yellow)); } if (priority > 5 && priority <= 9) { builder.setColor(resources.getColor(R.color.priority_green)); } } else { builder.setColor(resources.getColor(R.color.colorPrimary)); } // description String contentText = makePinNotificationContentText(context, task); if (contentText != null) { builder.setContentText(contentText); } // ticker text if (withTickerText) { builder.setTicker( context.getString(R.string.notification_task_pin_ticker, (TaskFieldAdapters.TITLE.get(task)))); } // click action Intent resultIntent = new Intent(Intent.ACTION_VIEW); resultIntent.setData(task.getUri()); resultIntent.setPackage(context.getPackageName()); PendingIntent resultPendingIntent = PendingIntent.getActivity(context, 0, resultIntent, PendingIntent.FLAG_UPDATE_CURRENT); builder.setContentIntent(resultPendingIntent); // complete action Boolean closed = TaskFieldAdapters.IS_CLOSED.get(task); if (closed == null || !closed) { Time dueTime = TaskFieldAdapters.DUE.get(task); long dueTimestamp = dueTime == null ? 0 : dueTime.toMillis(true); NotificationAction completeAction = new NotificationAction(NotificationUpdaterService.ACTION_COMPLETE, R.string.notification_action_completed, TaskFieldAdapters.TASK_ID.get(task), task.getUri(), dueTimestamp); builder.addAction(NotificationUpdaterService.getCompleteAction(context, NotificationActionUtils.getNotificationActionPendingIntent(context, completeAction))); } // unpin action builder.addAction(NotificationUpdaterService.getUnpinAction(context, TaskFieldAdapters.TASK_ID.get(task), task.getUri())); // sound if (withSound) { builder.setDefaults(Notification.DEFAULT_ALL); } else { builder.setDefaults(Notification.DEFAULT_LIGHTS); } return builder.build(); }
From source file:com.newcell.calltext.service.SipNotifications.java
public void showNotificationForMissedCall(ContentValues callLog) { int icon = android.R.drawable.stat_notify_missed_call; CharSequence tickerText = context.getText(R.string.missed_call); long when = System.currentTimeMillis(); if (missedCallNotification == null) { missedCallNotification = new NotificationCompat.Builder(context); missedCallNotification.setSmallIcon(icon); missedCallNotification.setTicker(tickerText); missedCallNotification.setWhen(when); missedCallNotification.setOnlyAlertOnce(true); missedCallNotification.setAutoCancel(true); missedCallNotification.setDefaults(Notification.DEFAULT_ALL); }/* w w w.j av a 2s . c o m*/ Intent notificationIntent = new Intent(SipManager.ACTION_SIP_CALLLOG); notificationIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); PendingIntent contentIntent = PendingIntent.getActivity(context, 0, notificationIntent, PendingIntent.FLAG_CANCEL_CURRENT); String remoteNumber = SipUri.getPhoneNumberFromApiSipString(callLog.getAsString(CallLog.Calls.NUMBER)); String remoteName = callLog.getAsString(CallLog.Calls.CACHED_NAME); /* * 6/11/2014 Change missed call notification * */ missedCallNotification.setContentTitle(context.getText(R.string.missed_call)); missedCallNotification.setContentText(remoteNumber); if (remoteName != null) { missedCallNotification.setContentText(remoteName); } /* * */ missedCallNotification.setContentIntent(contentIntent); notificationManager.notify(CALLLOG_NOTIF_ID, missedCallNotification.build()); }