貌似是
intent = new Intent(MainActivity.this,Squat.class);startActivity(intent);换成
intent = new Intent(getActivity(),Squat.class);startActivity(intent);