I have a FloatingActionButton on MainActivity that just calls this CreateEvent activity (AKA class)
and when I click that action button it crashes with this error
Unable to start activity ComponentInfo{com.example.library/com.example.library.CreateEvent}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.EditText.setOnClickListener(android.view.View$OnClickListener)' on a null object reference
Here is the code it said the error is at inside CreateEvent
etStart = findViewById(R.id.etCreateStart);
etStart.setOnClickListener(v -> {
final Calendar c = Calendar.getInstance();
int hour = c.get(Calendar.HOUR_OF_DAY);
int minute = c.get(Calendar.MINUTE);
TimePickerDialog timePickerDialog = new TimePickerDialog(this, (view, hourOfDay, minute1) -> {
String fix_00 = String.format("%02d", minute1);
etStart.setText(hourOfDay + ":" + fix_00);
}, hour, minute, true);
timePickerDialog.show();
});