In activity_hello_moon.xml change to layout fragment. In HelloMoonActivity.java extends change from Activity to FragmentActivity