Intent i = new Intent(Intent.ACTION_VIEW); i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, i,
PendingIntent.FLAG_UPDATE_CURRENT); NotificationCompat.Builder builder = new NotificationCompat.Builder(this) .setAutoCancel(true) .setContentTitle("Intizone") //.setContentText(message+"\n"+url) .setStyle(new NotificationCompat.BigTextStyle().bigText(message)) .setContentText(message) .setSmallIcon(R.mipmap.ic_launcher) .setContentIntent(pendingIntent); NotificationManager manager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE); Notification notification = builder.build(); notification.defaults |= Notification.DEFAULT_VIBRATE; notification.defaults |= Notification.DEFAULT_SOUND; notification.flags |= Notification.FLAG_SHOW_LIGHTS; notification.ledARGB = 0xffffffff; notification.ledOnMS = 300; notification.ledOffMS = 1000; manager.notify(0, notification);
No comments:
Post a Comment