H开发者_JAVA技巧ow to open Calendar on Button Click and get clickable Date.
check this out: http://www.developer.com/ws/article.php/3850276/Working-with-the-Android-Calendar.htm
EDIT:
To open calendar from button click event add this code to onClick method:
Intent i = new Intent();
//Froyo or greater (mind you I just tested this on CM7 and the less than froyo one worked so it depends on the phone...)
cn = new ComponentName("com.google.android.calendar", "com.android.calendar.LaunchActivity");
//less than Froyo
cn = new ComponentName("com.android.calendar", "com.android.calendar.LaunchActivity");
i.setComponent(cn);
startActivity(i);
Try using the CalendarView widget, see docs here
This isn't a dialog, so you'd have to create a dialog, wrap it around a CalendarView and launch it yourself.
精彩评论