Notification.Builder
Intent intent = new Intent(this, Two.class); PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, intent, 0); Notification notification = new NotificationCompat.Builder(this) .setSmallIcon(R.drawable.ic_launcher) .setDefaults(Notification.DEFAULT_ALL) .setAutoCancel(true).setContentText("content text") .setContentTitle("content title") .setContentInfo("content info").setTicker("ticker") .setWhen(System.currentTimeMillis()) .setContentIntent(pendingIntent).build(); NotificationManager mgr = (NotificationManager) getSystemService(NOTIFICATION_SERVICE); mgr.notify(100, notification); mgr.cancel(100);