如图所示,我创建了一个日期选择器。当我在选项卡上运行程序时它会出现,但是当我尝试使用手机(HTC Glacier)时应用程序崩溃,我可以找出我错过了什么。请帮帮我。谢谢
这是我的日志:
06-24 16:52:05.003: E/AndroidRuntime(19717): Caused by: java.lang.IllegalArgumentException: current should be >= start and <= end
06-24 16:52:05.003: E/AndroidRuntime(19717): at android.widget.NumberPicker.setCurrent(NumberPicker.java:288)
06-24 16:52:05.003: E/AndroidRuntime(19717): at android.widget.DatePicker.updateSpinners(DatePicker.java:384)
06-24 16:52:05.003: E/AndroidRuntime(19717): at android.widget.DatePicker.init(DatePicker.java:379)
06-24 16:52:05.003: E/AndroidRuntime(19717): at ph.com.unilab.iReport.IreportMain.onCreate(IreportMain.java:85)
这是我在日期选择器的主要活动中的代码
....
calendar = Calendar.getInstance();
dp_Date = (DatePicker) findViewById(R.id.dp_Date);
dp_Date.init(80, calendar.get(Calendar.MONTH), calendar.get(Calendar.DATE), null);
dp_Date.setDescendantFocusability(DatePicker.FOCUS_BLOCK_DESCENDANTS);
dp_Date.init(2013, calendar.getTime().getMonth(), calendar.getTime().getDate(), new OnDateChangedListener()
{
public void onDateChanged(DatePicker view, int year, int monthOfYear,int dayOfMonth) {
}
});
....