Where is the option to add a new preference screen in Android Studio 0.4.0?

前端 未结 8 1634
梦毁少年i
梦毁少年i 2021-02-07 08:15
Android Studio 0.4.0

Hello,

I want to add a new Preference Screen in Android Studio. However, I cannot find the menu option to do it.

I

相关标签:
8条回答
  • 2021-02-07 08:38

    Try this in Android Studio 1.0.2. File ->New->Other. Select Activity->Settings Activity. Follow the wizard to add it to your application.

    0 讨论(0)
  • 2021-02-07 08:50

    The preference option doesn't exist anymore. You will need to right click the res->new->Android resource file and choose the resource type as xml in the dropdown. Then you will manually need to add the layout for preference xml.

    0 讨论(0)
  • 2021-02-07 08:52

    What I just did was creating a new "Android resource directory" res->new->Android resource directory. There you choose xml, which creates the xml folder. Right click on this xml folder -> new -> XML resource file and then it proposes Preference Screen.

    0 讨论(0)
  • 2021-02-07 08:52

    (For Windows, go to File > Settings > Editor > General) (For Mac, go to Android Studio > Preferences > Editor > General)

    0 讨论(0)
  • 2021-02-07 08:54

    In Android Studio 1.1.0: If you create a SettingsActivity it automatically sets up some xml preference resource files for you.

    1. Under src > main > java, right click a package (e.g. com.company.appname)
    2. New > Activity > Settings Activity
    3. Click Finish to accept the defaults
    4. Notice the new files:
      • SettingsActivity
      • values/strings_activity_settings.xml
      • xml (Directory)
        • pref_data_sync.xml
        • pref_general.xml
        • pref_headers.xml
        • pref_notification.xml

    Note: The Activity uses some deprecated code. It might be best to look at the latest documentation for creating a preferences activity: http://developer.android.com/reference/android/preference/PreferenceFragment.html and for creating the XML resource file: http://developer.android.com/reference/android/preference/Preference.html

    0 讨论(0)
  • 2021-02-07 08:57

    In Windows, Go to Settings Then Double Click on Editor

    0 讨论(0)
提交回复
热议问题