I have an Android project with Modules that provide specific functionality.
Now, if I define an Activity on the Module that extends from AppCompat and try to use it on the main app, the toolbar doesn't take the styles defined on the manifest (the activity is not using the main app theme).
So far I've tried:
Define the theme tag on the main application manifest.
android:theme="@style/AppTheme"
Define the activity on the main application manifest and set the theme there.
<activity android:name=".mymodule.views.MyActivity" android:configChanges="keyboardHidden|orientation|screenSize" android:windowSoftInputMode="adjustResize" android:screenOrientation="nosensor" android:theme="@style/AppTheme"> </activity>Define the activity on the module manifest and set the theme there.
<activity android:name=".views.MyActivity" android:configChanges="keyboardHidden|orientation|screenSize" android:windowSoftInputMode="adjustResize" android:screenOrientation="nosensor" android:theme="@style/AppTheme"> </activity>
My styles.xml file looks like this (for both the main app and the module):
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar"> <item name="colorPrimary">@color/primary</item> <item name="colorPrimaryDark">@color/primary_dark_color</item> <item name="colorAccent">@color/accent</item> ... </style> The toolbar XML is the following:
<android.support.v7.widget.Toolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" android:theme="@style/AppTheme" app:popupTheme="@style/ThemeOverlay.AppCompat.Light" app:theme="@style/AppTheme" /> I've tried both android:theme and app:theme to style specifically the Toolbar but still no change.
Any thoughts?
Thanks!
Theme.AppCompat.Light.DarkActionBarfor example?