Easy Challenge dialog showing up blank


I carefully followed the steps from chapter 12 to create another dialog for the time. However, the dialog is showing up on the emulator as a white strip across the screen (no title, no TimePicker, no PositiveButton). Can I have some guidance as to why this is occurring? I have included some pieces of relevant code:

public Dialog OnCreateDialog(Bundle savedInstanceState) {
View v = getActivity().getLayoutInflater().inflate(R.layout.dialog_time, null);
return new AlertDialog.Builder(getActivity())
.setPositiveButton(android.R.string.ok, null)

public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) {

mTimeButton = (Button)v.findViewById(R.id.crime_time);
mTimeButton.setOnClickListener(new View.OnClickListener()
{ @Override
public void onClick(View v) {
FragmentManager fm = getActivity().getSupportFragmentManager();
TimePickerFragment dialog = TimePickerFragment.newInstance(mCrime.getDate());
dialog.setTargetFragment(CrimeFragment.this, REQUEST_DATE);
dialog.show(fm, DIALOG_DATE);

return v;


I found the error myself, after 2 days of frustration.

I had a capital “O” in OnCreateDialog where it should have been onCreateDialog. Eclipse didn’t point out the error because I didn’t use @Override…lesson learned the hard way!