Home >Java >javaTutorial >How to Fix 'android:exported needs to be explicitly specified for ' Error in Android 12 and Higher?
android:exported needs to be explicitly specified for
According to the error message, you need to explicitly specify the android:exported attribute for all activities that have an intent filter defined. In your AndroidManifest.xml file, set the android:exported attribute to false for all activities that should not be accessible by other applications, such as internal activities or activities that are only used for specific purposes within your app.
Here's an example of how to set the android:exported attribute in your AndroidManifest.xml file:
In this example, the MainActivity is exported and can be accessed by other applications, while the SettingsActivity is not exported and cannot be accessed by other applications.
Once you have set the android:exported attribute for all activities in your app, you can try building your app again. The error message should no longer appear.
The above is the detailed content of How to Fix 'android:exported needs to be explicitly specified for ' Error in Android 12 and Higher?. For more information, please follow other related articles on the PHP Chinese website!