the problem is that each time you chnage the orientation the fragment is recreated that is where the null pointer came from.
solution:
you could either prevent it to landscape add this to ur activity manifest android:screenOrientation="portrait"
or
if you want to live the fragment like the lifecyle of the activity you need to add the setRetainInstance(true)