A notification is a message you display to the user outside of your apps normal UI. When you tell the system to issue a notification, it first appears as an icon in the notification area. To see the details of the notification, the user opens the notification drawer. Both the notification area and the notification drawer are system-controlled areas that the user can view at any time.
Notification Compat.Builder b=new NotificationCompatBuilder(this);
b.setContentTitle(“Title”);
b.setContentText(“Messahe”);
b.setSmallIcon(R.drawable.image);
Intent i=new Intent(this,Second.class);
PendingIntent pi=PendingIntent.getActivity(this,i,pendingIntent.Flag_Update_Current);
b.setContentIntent(pi);
b.setAutoCancel(true);
Notification n=b.build();
NotificationManager m=(notificationManager)getSystem Service(Notification_Service);
m.notify(2,n);
}
});
}
Comments
Post a Comment