Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Theme.AppCompat.Light.NoActionBar not working after migrating to androidx

Tags:

android

I was using Theme.AppCompat.Light.NoActionBar on my activities which worked flawlessly but I had to migrate to Androidx to use a library and after migrating there's now an actionBar.

I tried googling but could not get any fixes

Here's my code

Style.xml

<style name="NoActionBar" 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>

Manifest.xml

<activity android:name=".LoginActivity" android:theme="@style/NoActionBar"
        android:configChanges="orientation" android:screenOrientation="portrait"/>
like image 846
tony Avatar asked Nov 21 '25 10:11

tony


2 Answers

Always after Migrating to AndroidX it's better to do: File Menu > Invalidate Caches / Restart

like image 160
Sabrina Avatar answered Nov 24 '25 22:11

Sabrina


I fixed it. I just cleaned and rebuilt the project

like image 43
tony Avatar answered Nov 24 '25 23:11

tony