Hello! I read on the Internet that activations usually do

public class Settings extends PreferenceActivity { 

In my application there is a navigationDrawer , and in one of the items I want to make the "Settings" so that another fragment appears, similar to the PreferenceActivity . Is this the right thing to do?

As I already understood, it is easier to work with Aсtivity , since more methods available. For me this is an advantage, due to lack of experience.

  • one
    If a fragment is needed, then the SDK has [ PreferenceFragment ] [1]. But it is available with API 11 and higher. [1]: developer.android.com/reference/android/preference/… - falstaf
  • @falstaf thanks, but of course under the 8 level is preferable - Garf1eld
  • Then you, alas, have no choice but to use the PreferenceActivity . - falstaf

1 answer 1

As already said, for API 11+ there is a PreferenceFragment . I always do applications with support for earlier versions, so this option is not suitable.

So, either in the usual fragment, you can do everything yourself, or use this solution, for example.