Skip to content

Instantly share code, notes, and snippets.

@ameliacv
Created February 11, 2019 04:19
Show Gist options
  • Save ameliacv/177fd1e30710e40b69fa42adc1e7ed67 to your computer and use it in GitHub Desktop.
Save ameliacv/177fd1e30710e40b69fa42adc1e7ed67 to your computer and use it in GitHub Desktop.
Intent intent = new Intent(WHAT EVER YOU WANT);
//u can put extra data too
PendingIntent pendingIntent = PendingIntent.getActivity(CONTEXT, 1, intent, 0);
NotificationCompat.Builder mBuilder =
(NotificationCompat.Builder) new NotificationCompat.Builder(CONTEXT)
.setSmallIcon(YOUR ICON)
.setContentTitle(CONTEXT.getString(R.string.alert_success_upload))
.setContentText(BLAH);
mBuilder.setContentIntent(pendingIntent);
notificationManager =
(NotificationManager) mContext.getSystemService(Context.NOTIFICATION_SERVICE);
notificationManager.notify(1, mBuilder.build());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment