9

I used the Settings Activity template to create a new activity in android studio. After creating it, I cannot find the layout file of the activity anywhere. Where can I find the layout file? If there is no layout file for Settings Activity template, how can I change its contents?

Android studio also created a new folder called xml, does this have anything to with the settings activity?

Sweeper
  • 176,635
  • 17
  • 154
  • 256
  • Yes, it's in the `xml` folder – Karakuri Jul 22 '15 at 23:47
  • In your Java Settings Activity file, there is probably a reference to a layout/resource file (e.g. in mine there is a line `loadHeadersFromResource(R.xml.preferenceheaders, target);`). – Vince Jul 22 '15 at 23:47

2 Answers2

8

Settings Activities typically use preferences defined in an XML file. These aren't exactly layouts, so they are usually placed in the xml resource subdirectory. Read more about preference-based settings screens on this page.

Karakuri
  • 37,627
  • 12
  • 79
  • 103
0

By default the Settings activity extends PreferenceActivity which has a standard layout. The layout is shown in the documentation Nonetheless, if you want to change it, you can refer to this question

Community
  • 1
  • 1
gusridd
  • 854
  • 10
  • 16