0

I wnat to apply theme , so I quote it on Application or Some Activity tag, but neighther Application tag nor Activity tag work. how can I apply it? Mainifest.xml:

 <application
    android:name=".base.CustomApplication"
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:roundIcon="@mipmap/ic_launcher_round"
    android:supportsRtl="true"
    android:theme="@style/Activity_Base_Setting">

    <!-- android key -->
    <meta-data
        android:name="com.google.android.geo.API_KEY"
        android:value="@string/google_maps_key"/>
    <meta-data
        android:name="com.google.android.gms.version"
        android:value="@integer/google_play_services_version"/>
    <meta-data
        android:name="android.max_aspect"
        android:value="2.1"/>

    <activity
        android:configChanges="orientation|screenSize|keyboard"
        android:name=".ui.activity.MainActivity"
        android:launchMode="singleTop"
        android:theme="@style/Activity_Base_Setting">
    </activity>
    <activity
        android:noHistory="true"
        android:name=".ui.activity.SplashActivity">
        <intent-filter>
            <action android:name="android.intent.action.MAIN"/>
            <category android:name="android.intent.category.LAUNCHER"/>
        </intent-filter>
    </activity>
</application>

values/styles.xml

<style name="Activity_Base_Setting" parent="AppTheme">
    <item name="android:launchMode">singleTop</item>
    <item name="android:configChanges">screenSize|keyboard|orientation</item>
    <item name="android:screenOrientation">portrait</item>
</style>

I don't want write it like this ,

  <activity
        android:screenOrientation="portrait"
        android:configChanges="orientation|screenSize|keyboard"
        android:launchMode="singleTop"
        android:name=".ui.activity.MainActivity">
Kevin Yuan
  • 307
  • 3
  • 13
  • Possible duplicate of [Android theme won't apply to activity](https://stackoverflow.com/questions/18445550/android-theme-wont-apply-to-activity) – unzila Mar 28 '19 at 03:25
  • No, different. the question talking about setting like "launch mode, orientation,config" different with “UI theme” , I saw some blog it work when apply UI theme, and I also want know why won't apply activity and wont' apply application – Kevin Yuan Mar 28 '19 at 06:23

0 Answers0