App crashing after theme update

后端 未结 3 1589
无人及你
无人及你 2021-01-29 13:53

The app I was working on so far was working fine until I added a couple of new activities and tried applied some changes to the theme.

The following is my styles.xml fi

相关标签:
3条回答
  • 2021-01-29 14:35

    change your manifest file :

    <activity android:name=".UserManagement.RegisterUserActivity"
            android:label="@string/app_name"
            android:theme="@style/AppTheme.AppBarOverlay">
    </activity>
    

    to this :

    <activity android:name=".UserManagement.RegisterUserActivity"
                android:label="@string/app_name"
                android:theme="@style/AppTheme">
    </activity>
    

    i think your RegisterUserActivity problem will be solve...

    UPDATE for your MainActivty Chnage style.xml

    <!-- Base application theme. -->
    <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
        <!-- Customize your theme here. -->
        <item name="colorPrimary">@color/colorPrimary</item>
        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
        <item name="colorAccent">@color/colorAccent</item>
        <item name="windowActionBar">false</item>
        <item name="windowNoTitle">true</item>
    </style>
    
    0 讨论(0)
  • 2021-01-29 14:39

    It works with the following changes to the code:

    <style name="AppTheme" 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>
        <item name="android:windowNoTitle">true</item>
        <item name="android:windowFullscreen">true</item>
    </style>
    
    0 讨论(0)
  • 2021-01-29 14:49

    Put this code in your style.xml

    <style name="AppTheme.NoActionBar">
        <item name="windowActionBar">false</item>
        <item name="windowNoTitle">true</item>
    </style>
    

    and don't add parent ="AppTheme" in the above code.

    0 讨论(0)
提交回复
热议问题