Posts

Showing posts with the label dialog

Custom Dialog With Call Back in Android

Image
What is Dialog in Android : A dialog is a small window that prompts the user to make a decision or enter additional information. A dialog does not fill the screen and is normally used for modal events that require users to take an action before they can proceed. Create Custom Layout :   If you want a custom layout in a dialog, create a layout and add it to an AlertDialog by calling setView() on your AlertDialog.Builder object or add it to  Dialod by calling setContentView() on your Dialog object. . Dialog Methods : cancel() : Cancel the dialog. dismiss() : Dismiss the dialog. Removing it from screen . setContentView(int resId) : Set the screen content from layout resource. setCanceledOnTouchOutside(boolean cancel) : Sets whether this dialog is canceled when touched outside the window's bounds.  setCancelable(boolean value) : Sets whether this dialog is cancelable with the BACK key.  requestWindowFeature(int featuredId) : Enable extend...

Date and Time picker dialog in android

Image
Showing DatePickerDialog and TimePickerDialog are the most common feature in android app. DatePickerDialog helps you to pick date and TimePickerDialog helps you to pick time from dialog . TimePickerDialog allows you to pick time either 24 hour or 12 hour mode . These two picker dialog has two different callback methods respectively . DatePickerDialog and TimePickerDialog classes are consists of 5 arguments constructor . DatePickerDialog Constructor :  1. Context  : Require Application context  2. new DatePickerDialog.OnDateSetListener(){         onDataSet()  // this method execute when user select date and press ok button           {            a. Year  // selected year            b. Month // selected month , it's return previous month. Suppose you select Marc...