Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Intent intent = new Intent(context, LiveFeedScreen.class);
- intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);
- intent.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);
- final int not_nu = generateRandom();
- PendingIntent pendingIntent = PendingIntent.getActivity(context,
- not_nu, intent, PendingIntent.FLAG_ONE_SHOT);
- NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(
- context)
- .setSmallIcon(R.drawable.notificationbig_icon)
- .setColor(context.getResources().getColor(R.color.header_blue))
- .setContentTitle(context.getString(R.string.app_name))
- .setContentText(mMessage)
- .setAutoCancel(true)
- .setStyle(
- new NotificationCompat.BigTextStyle().bigText(mMessage))
- .setContentIntent(pendingIntent);
- NotificationManager notificationManager = (NotificationManager) context
- .getSystemService(Context.NOTIFICATION_SERVICE);
- notificationManager.notify(not_nu, notificationBuilder.build());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement