Kir*_*Rao 4 android android-manifest
清单属性是否可以根据 Android SDK 版本进行更改?
例如:已经android:largeHeap是true当SDK版本<24和false当SDK> = 24?
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.androidapp">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:largeHeap="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
Run Code Online (Sandbox Code Playgroud)
尝试这个
res/values/bool.xml
<resources>
<bool name="largeheap">true</bool>
</resources>
Run Code Online (Sandbox Code Playgroud)
res/values-v24/bool.xml
<resources>
<bool name="largeheap">false</bool>
</resources>
Run Code Online (Sandbox Code Playgroud)
Android 清单文件:
<application
android:largeHeap="@bool/largeheap"
android:allowBackup="true"
android:icon="@drawable/ic_launcher">
....
</application>
Run Code Online (Sandbox Code Playgroud)
请true在res/values/bool.xml和false中res/values-v24/bool.xml。Android API 级别 24,因此-v24将用于 24 及更高版本。
| 归档时间: |
|
| 查看次数: |
203 次 |
| 最近记录: |