Search code examples
androidandroid-layoutandroid-theme

Android Studio - Layout Theme Selection -- Where is this data stored?


I am quite familiar with Android layouts and the fact you can declare an app wide theme in the manifest or indirectly via the Styles resource such as "Halo", or "Material", etc... .

I also know that style can be done on a per layout basis. Android Studio "Layout Editor" even allows you to select a theme for the layout.

Question:

Where is the selected theme stored when applied per layout?


The Android Documentation seems to suggest its in the manifest where the activities are declared. For example:

<activity android:name=".MainMenu"  `android:theme="@android:style/Theme.Holo.NoActionBar"/>`

However, when I select a different theme, even after I compile and run the application I see no changes in the manifest, or respective layout, or the Activity sub class.

So where is the association between a layout and the chosen theme for it being stored?


Solution

  • I believe the answer to this question is that Android Studio does not currently modify anything when you select a layout in the preview, it is just a preview and that is it.

    To make the change one has to manually edit the theme for the activity entry in the manifest.