Matt Deemer
Matt Deemer

Reputation: 133

Android Studio Themes Don't Work in App

I'm just getting started with Android development and have literally only been doing it for a few hours.

Using the new Android Studio I've created a basic one-button app which creates a Toast text when I press it. Whoopee.

Problem is - when I select a "Theme" for my app layout page from the GUI, and select for example Halo (or any of them), it only changes my PREVIEW in the Android Studio. When I press "Run" (or export it to an apk), everything goes back to basic white style.

It's as if it doesn't include the style/theme when building my app

Upvotes: 3

Views: 21372

Answers (3)

Chandrahasa Rai
Chandrahasa Rai

Reputation: 457

Make sure that your activity file extends AppCompatActivity

public class ActivityName extends AppCompatActivity {
---------
--------
}

Upvotes: 1

Matt Deemer
Matt Deemer

Reputation: 133

Thank you! I changed the style.xml file to be this and it changed instantly...

<resources>
<style name="AppTheme" parent="Theme.AppCompat">
</style>
</resources>

Upvotes: 2

user3065137
user3065137

Reputation:

You may look at this link:

http://developer.android.com/guide/topics/ui/themes.html

and add something like this

<application android:theme="@android:style/NameOftheTheme">

or this

<application android:theme="@android:style/Theme.Holo">

with the theme name you'd like in your AndroidManifest.xml

Upvotes: 2

Related Questions