While fixing a bug I introduced when manually refactoring, I found that I put this code in the fragment's onCreateView method instead of onStart

```
    EditText et = getActivity().findViewById(R.id.testEditText);
    et.setOnEditorActionListener(new TextView.OnEditorActionListener()
    {
        @Override
        public boolean onEditorAction(TextView textView, int actionId, KeyEvent event)
        {

            boolean handled = false;

            if (actionId == EditorInfo.IME_ACTION_DONE)
            {
                // Do something.
                handled = true;
            }

            return handled;
        }
    });

```

Having fixed the bug I found myself pondering why the EditText widget is null in onCreateView, and I don't know the answer. I've never really thought about it before, so I googled and checked the manuals but can't find an answer, so can anyone tell me why?