0
這是我的代碼,它沒有顯示任何錯誤。當我嘗試運行時,它正在關閉,ClassCastException
。Date Picker在SherlockFragmentActivity上越來越接近力量
注:相同的代碼工作時,延伸到SherlockFragment
public class EventsFeatured extends SherlockFragmentActivity {
TextView cal;
View view;
int year;
int month;
int day;
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
view = inflater.inflate(R.layout.events_featured, container, false);
iniitialize();
return view;
}
private void iniitialize() {
// TODO Auto-generated method stub
Calendar t = Calendar.getInstance();
year = t.get(Calendar.YEAR);
month = t.get(Calendar.MONTH);
day = t.get(Calendar.DAY_OF_MONTH);
cal = (TextView) view.findViewById(R.id.tvCalendar);
cal.setText(new StringBuilder()
.append(month + 1).append("-").append(day).append("-")
.append(year).append(" "));
}
}