Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Start:
- Builder nCompatBuilder = new NotificationCompat.Builder(this);
- nCompatBuilder.setAutoCancel(false);
- nCompatBuilder.setOngoing(true);
- nCompatBuilder.setContentTitle(getString(R.string.app_name));
- nCompatBuilder.setContentText(contentText);
- nCompatBuilder.setContentIntent(contentIntent);
- nCompatBuilder.setSmallIcon(R.drawable.ic_menu_capture);
- Notification notification = nCompatBuilder.getNotification();
- notificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
- notificationManager.notify(CAPTURING_ROUTE, notification);
- Stop:
- notificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
- notificationManager.cancel(CAPTURING_ROUTE);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement