0% found this document useful (0 votes)
64 views8 pages

Android Notifications

Uploaded by

giratheayush
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
64 views8 pages

Android Notifications

Uploaded by

giratheayush
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 8

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

• Andorid Toast can be used to display information for the short


period of time. A toast contains message to be displayed quickly and
disappears after sometime.
• The android.widget.Toast class is the subclass of java.lang.Object
class.
• Toast class is used to show notification for a particular interval of
time. After sometime it disappears. It doesn't block the user
interaction.
Android Toast
• Methods of Toast class
Method Description
public static Toast makeText(Context
context, CharSequence text, int makes the toast containing text and duration.
duration)
public void show() displays toast.
public void setMargin (float changes the horizontal and vertical margin
horizontalMargin, float verticalMargin) difference.

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

• Android SeekBar is a kind of ProgressBar with


draggable thumb. The end user can drag the thum left
and right to move the progress of song, file download
etc.
• The SeekBar.OnSeekBarChangeListener interface
provides methods to perform even handling for seek
bar.
Android DatePicker

• Android DatePicker is a widget to select date.


It allows you to select date by day, month
and year. Like DatePicker, android also
provides TimePicker to select time.
• The android.widget.DatePicker is the subclass
of FrameLayout class.

You might also like