Layout fragment crashes


#1

When i added the in listing 13.4 and changed HelloMoonActivity to extend FragmentActivity the code crashes when it loads. Here is the Logcat output:

Lots of people have seen this Exception, but none of them seem to happen with FragmentActivity.

What is causing this?


#2

The problem was that I was inflating activity_hello_moon instead of fragment_hello_moon in HelloMoonFragment.onCreate().