Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void shownotification(String message, Context context) {
- NotificationManager mNotificationManager = (NotificationManager) context
- .getSystemService(context.NOTIFICATION_SERVICE);
- NotificationCompat.Builder mNotifyBuilder = new NotificationCompat.Builder(
- context).setContentTitle("my app").setContentText(message)
- .setDefaults(Notification.DEFAULT_ALL).setAutoCancel(true)
- .setSmallIcon(R.drawable.Mypic);
- Notification notification = mNotifyBuilder.build();
- notification.flags |= Notification.FLAG_AUTO_CANCEL;
- mNotificationManager.notify(0, notification);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement