Android Notifications
Android Notifications
Android Notifications
• A notification is a message that Android displays outside your app's UI to provide the user
with reminders, communication from other people, or other timely information from your
app. Users can tap the notification to open your app or take an action directly from the
notification.
• Notifications could be of various formats and designs depending upon the developer:
1.Status Bar Notification (appears in the same layout as the current time, battery percentage)
2.Notification drawer Notification (appears in the drop-down menu)
3.Heads-Up Notification (appears on the overlay screen, ex: Whatsapp notification, OTP
messages)
4.Lock-Screen Notification
Android
Notifications
Template
Android Toast
Toast toast=Toast.makeText(getApplicationContext(),"HelloJavatpoint",Toast.LENGTH_SHORT);
toast.setMargin(50,50);
toast.show();
Android AlertDialog
• Android AlertDialog can be used to display the dialog
message with OK and Cancel buttons. It can be used to
interrupt and ask the user about his/her choice to
continue or discontinue.
• Android AlertDialog is composed of three regions: title,
content area and action buttons.
• Android AlertDialog is the subclass of Dialog class.
Method Description
public AlertDialog.Builder setTitle(CharSequence) This method is used to set the title of AlertDialog.
This method is used to set the message for
public AlertDialog.Builder setMessage(CharSequence)
AlertDialog.
public AlertDialog.Builder setIcon(int) This method is used to set the icon over AlertDialog.
Android SeekBar