最佳答案
您好,访问所有给定的链接,希望对您有所帮助
原文链接:https://www.f2er.com/android/431069.html1.https://github.com/inteist/android-better-time-picker
2.https://github.com/derekbrameyer/android-betterpickers
3.http://www.androiddevelopersolutions.com/2013/05/android-calendar-sync.html
4.http://www.androidviews.net/2013/04/extendedcalendarview/
5.http://abinashandroid.wordpress.com/2013/07/21/how-to-create-custom-calendar-in-android/
6.http://w2davids.wordpress.com/android-simple-calendar/
7.https://github.com/roomorama/Caldroid
8.https://github.com/flavienlaurent/datetimepicker
当您访问以下内容时:
https://github.com/derekbrameyer/android-betterpickers
有关此项目的工作实现,请参阅示例/文件夹.
实现适当的Handler回调:
public class MyActivity extends Activity implements DatePickerDialogFragment.DatePickerDialogHandler {
@Override
public void onCreate(Bundle savedInstanceState) {
// ...
}
@Override
public void onDialogDateSet(int year,int monthOfYear,int dayOfMonth) {
// Do something with your date!
}
}
使用其中一个Builder类创建一个带主题的PickerDialog:
DatePickerBuilder dpb = new DatePickerBuilder()
.setFragmentManager(getSupportFragmentManager())
.setStyleResId(R.style.BetterPickersDialogFragment);
dpb.show();
还有另一个例子,你可以访问
https://github.com/roomorama/Caldroid
并使用如下
要在您的活动中嵌入caldroid片段,请使用以下代码:
CaldroidFragment caldroidFragment = new CaldroidFragment();
Bundle args = new Bundle();
Calendar cal = Calendar.getInstance();
args.putInt(CaldroidFragment.MONTH,cal.get(Calendar.MONTH) + 1);
args.putInt(CaldroidFragment.YEAR,cal.get(Calendar.YEAR));
caldroidFragment.setArguments(args);
FragmentTransaction t = getSupportFragmentManager().beginTransaction();
t.replace(R.id.calendar1,caldroidFragment);
t.commit();