NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(Main.this) .setSmallIcon(android.R.drawable.stat_sys_warning) .setLargeIcon((((BitmapDrawable)getResources() .getDrawable(R.mipmap.ic_launcher)).getBitmap())) .setContentTitle("Mensaje") .setContentText("Nuevo Mensaje") .setContentInfo("1") .setTicker("Alerta!"); Intent notIntent = new Intent(Main.this, Main.class); PendingIntent contIntent = PendingIntent.getActivity( Main.this, 0, notIntent, 0); mBuilder.setContentIntent(contIntent); NotificationManager mNotificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); mNotificationManager.notify(1, mBuilder.build()); |