First extend FragmentActivity
and make sure you are using the one from the support library.
Try using getSupportFragmentManager().beginTransaction()
instead of getFragmentManager().beginTransaction()
.
The problem is that you have imported FragmentTransaction from v4 support library and you are not using the fragment manager from the v4 support library.
Here is the link for further refrence.
Hope this helps : )