sajjad muhammadi
sajjad muhammadi

Reputation: 241

change theme in manifest not working

i define two theme in styles.xml AppTheme1 and AppTheme2:

<resources>

<!-- Base application theme. -->
<style name="AppTheme1" parent="Theme.AppCompat.Light.NoActionBar">
    <!-- Customize your theme here. -->
    <item name="colorPrimary">@color/colorPrimary</item>
    <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
    <item name="colorAccent">@color/colorAccent</item>
</style>

<style name="AppTheme2" parent="Theme.AppCompat.Light.NoActionBar">
    <!-- Customize your theme here. -->
    <item name="colorPrimary">#00ff00</item>
    <item name="colorPrimaryDark">#ff00ff</item>
    <item name="colorAccent">#0000ff</item>
</style>
</resources>

when i change theme in application tag inside AndroidManifest.xml my app theme doesn't any change and the app only use colors.xml and not styles.xml. for example my manifest file:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.maneshtsoft.blackdictionary">

<application
    android:allowBackup="true"
    android:icon="@mipmap/favicondark"
    android:label="@string/app_name"
    android:supportsRtl="true"
    android:theme="@style/AppTheme2">
    <!-- OR AppTheme1 does not matter -->
    <activity android:name=".MainActivity">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
</application>

</manifest>

just say that i use toolbar and AppCompactActivity maybe help to answer. thanks.

Upvotes: 1

Views: 2358

Answers (1)

nshmura
nshmura

Reputation: 6010

The problem may be the cache of InstantRun.
Did you try "Clean & Rerun"? If you use AndroidStudio 2.1 or higher, Select Menu -> Run -> Clean & Rerun.

Upvotes: 1

Related Questions