简体   繁体   中英

Conflict with AppTheme my app cant use built-in actionBar but one of the library require actionBar in AppTheme

If i use AppTheme without ActionBar than i get crash when i call WeAccept Payment SDK because they require Actionbar to be available in AppTheme.

My code:

<style name="AppTheme" parent="Theme.AppCompat.DayNight.NoActionBar">
    <item name="colorPrimary">@color/DefaultPrimary</item>
    <item name="colorPrimaryDark">@color/DefaultPrimaryDark</item>
    <item name="colorAccent">@color/DefaultAccent</item>
    <item name="android:textColorHint">@color/DefaultPrimary</item>
    <item name="android:actionButtonStyle">@style/MyActionButtonStyle</item>
    <item name="android:typeface">serif</item>

</style>

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

And in Manifest i use android:theme="@style/AppTheme.NoActionBar"

Note: i cant display the default ActionBar in my application because if the custom design

With himanshu help i managed to get it working after creating new theme with different name in styles and adding that sdk activity in my main manifest (it seems that it will override their manifest).

<activity
    android:name="com.paymob.acceptsdk.PayActivity"
    android:theme="@style/AppThemePayment" />

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM