1

Hi I`m looking to display SettingsFragment by pressing settings button on my bottom navigation drawer but I cant do it for some reason. Here is my fragment class

public class SettingsFragment extends PreferenceFragment {
private static final String ARG_SECTION_NUMBER = "section_number";


public static android.app.Fragment newInstance(int sectionNumber)
{
    SettingsFragment fragment = new SettingsFragment();
    Bundle args = new Bundle();
    args.putInt(ARG_SECTION_NUMBER, sectionNumber);
    fragment.setArguments(args);
    return fragment;
}

public SettingsFragment()
{

}
}

and here is how I try to get it to show in my activity

 case R.id.navigation_settings:
                setTitle("Settings");
                android.app.Fragment infoFragment = new SettingsFragment();
                FragmentTransaction ft = getFragmentManager().beginTransaction();
                ft.add(android.R.id.content, infoFragment);
                ft.commit();
                return true;

I`ve seen that solution from here Android: Preference Fragment with a Navigation Drawer's Fragment but I cant really understand where the xml file is called

redberry
  • 696
  • 7
  • 15

0 Answers0