time

Android Time Picker Dialog Example

In Android, we can display Time Picker in the dialog box itself.
Here is an example to show how to display the time picker in the dialog box in order to get the time.

[sourcecode language="xml"]
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
androi

Android DatePicker Dialog Example

Now we can display android datepicker dialog box in all android mobile phones.

Example for Android Datepicker Dialog :

[sourcecode language="java"]
public class ExampleApp extends Activity implements Button.OnClickListener {
private Button b1;
static final int DATE_DIALOG_ID = 0;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
// Adding button to the layout
b1=(Button)findViewById(R.id.Button01);
b1.setOnClickListener(this);
}
// Creating dialog
@Override
protected Dialog onCreat

Syndicate content