我怎样才能避免这种情况.. 我可以运行我的应用程序没有任何错误。但是当我生成APK时,它会收到此错误。 我不知道如何解决这个错误 请帮助!!
public class DatePickerFragment extends DialogFragment implements DatePickerDialog.OnDateSetListener {
DatabaseAdapter databaseHelper;
public EditText activity_edittext;
public DatePickerFragment(EditText edit_text) {
activity_edittext = edit_text;
}
public DatePickerFragment(){}
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
// Use the current date as the default date in the picker
final Calendar c = Calendar.getInstance();
int year = c.get(Calendar.YEAR);
int month = c.get(Calendar.MONTH);
int day = c.get(Calendar.DAY_OF_MONTH);
databaseHelper = new DatabaseAdapter(getActivity());
// Create a new instance of DatePickerDialog and return it
return new DatePickerDialog(getActivity(), this, year, month, day);
}
@Override
public void onDateSet(DatePicker view, int year, int month, int day) {
activity_edittext.setText(String.valueOf(month + 1 ) + "/" + String.valueOf(day) + "/" + String.valueOf(year));
}
}