I have a simple fragment activity. In the onCreate() method, I simply add a fragment. The code is posted below. However, each time I rotate the screen, system will call onCr
Well, as you error says, something is wrong with your MyFragment class. Make sure you have something like:
public class MyFragment extends Fragment
when declaring your fragment class. Also, you shouldn't have any constructor in the class. So make sure that you don't have one.
If you post the code for your Fragment class we might be able to help you better.