Tuesday, 6 October 2015

Type of android intents and dialog's

Intent: is a message passing mechanism between components of android except ContentProvider .You can use intent to start any component.
Sticky Intent : It sticks with android for future broad cast listeners. Ex-if BATTERY_LOW event occures then that intent will be stick with android so that if in future battery low occures while app is running that intent will be fired.
Pending Intent: If you want someone to perform any Intent operation at future point of time on behalf of you ,then we will use pending Intent.
Ex- 
Booking a ticket at late night when your application is not running. In this scenario we will create a pending intent to start a service which can book tickets at late night and hand it over to Alarm Manager to fire it at that time.

Types of DialogBox

A dialogBox is a small window that prompts the user to make a decision or enter additional information. A dialogBox does not fill the screen and is normally used for modal events that require users to take an action before they can proceed, like to select date from DatePicker Dialog, to select time from time picker Dialog, to show the Progress, to show a list of items or options to select etc.
Alert Dialog:
     A dialog that can show a title, up to three buttons, a list of selectable items, or a custom layout.
DatePicker Dialog and TimePicker Dialog: 
       A dialog with a pre-defined UI that allows the user to select a date or time.
Progress Dialog: 
     A Dialog that can show a title, ProressBar and a message, or a custom layout.
List Dialog: 
     A Dialog that can show a title, List of items and a message, or as above a custom layout.

No comments:

Post a Comment