ошибка фрагмента android studio

#android #android-fragments

#Android #android-фрагменты

Вопрос:

Я пытаюсь выполнить действие с вкладками с помощью 3 фрагментов Android Studio, но мой код вылетает при попытке перейти на другую вкладку.

Проблема, в которой я верю в эту часть, но я не в состоянии ее решить

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState)
    {

        if (getArguments().getInt(ARG_SECTION_NUMBER) ==1)
        {
            View rootView = inflater.inflate(R.layout.fragment_fragment_settings, container, false);
            return rootView;
        }
        else if (getArguments().getInt(ARG_SECTION_NUMBER)== 2)
        {
            View rootView = inflater.inflate(R.layout.fragment_main, container, false);
            return rootView;
        }
        else
        {
            View rootView = inflater.inflate(R.layout.fragment_fragment_courses, container, false);
            TextView textView = (TextView) rootView.findViewById(R.id.section_label);
            textView.setText(getString(R.string.section_format, getArguments().getInt(ARG_SECTION_NUMBER)));
            return rootView;
        }
    }
} 
  

`

Комментарии:

1. Пожалуйста, опубликуйте трассировку стека

2. Вы можете получить помощь от simplifiedcoding.net /…