Using onConfigurationChanged in a fragment
问题 I have this code in a fragment public class TestOne extends Fragment { View view = null; @Override public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); LayoutInflater inflater2 = (LayoutInflater)getActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE); view = inflater2.inflate(R.layout.testone, null); Toast.makeText(getActivity(), "Rotate fragment", Toast.LENGTH_SHORT).show(); } @Override public void onCreate(Bundle savedInstanceState)