何为explicit value
时间: 2023-03-27 10:00:56 浏览: 165
Explicit value 是指在编程中明确指定的数值或变量值,而不是通过计算或推断得出的值。例如,在 C 语言中,可以使用赋值语句将一个明确的值分配给变量,例如 int x = 5; 这里,5 就是一个明确的值。
相关问题
Apps targeting Android 12 and higher are required to specify an explicit value for `android
:exported` attribute in the AndroidManifest.xml file for all components (activities, services, receivers, providers). This attribute indicates whether a component is accessible from other apps or not. It helps enhance the security of Android apps by explicitly defining the accessibility of each component.
Previously, if this attribute was not specified, the default behavior was that components were considered exported. However, starting from Android 12, specifying an explicit value for this attribute is mandatory for all components.
To specify the value for `android:exported`, you need to set it to either `true` or `false` depending on your app's requirements. If you want to allow other apps to access the component, set it to `true`. If you want to restrict access to only your app, set it to `false`.
Here is an example of how the `android:exported` attribute can be set for an activity in the AndroidManifest.xml file:
```xml
<activity android:name=".MainActivity"
...
android:exported="true">
...
</activity>
```
Make sure to review and update the `android:exported` attribute for all components in your AndroidManifest.xml file when targeting Android 12 and higher to comply with the new requirement.
Apps targeting Android 12 and higher are required to specify an explicit value for `android:exported`
Apps targeting Android 12 and higher are required to specify an explicit value for `android:exported` when the corresponding component has an intent filter defined. This requirement is mentioned in the Android documentation, specifically in the section on the `<activity>` element of the manifest file. If you fail to specify the `android:exported` attribute with an explicit value, your app will not be able to be installed on devices running Android 12 or higher.
阅读全文