Android四大组件都有 android:exported 属性
android:exported="true" 时 表示该组件是公开的,其它组件可以访问这个组件
android:exported="false" 时表示该组件是私有的,只有自己或有相关权限的其它组件可以访问
1 <application 2 android:allowBackup="true" 3 android:icon="@drawable/ic_launcher" 4 android:label="@string/app_name" 5 android:theme="@style/AppTheme" > 6 <activity 7 android:name=".MainActivity" 8 android:exported="false" 9 android:label="@string/app_name" > 10 <intent-filter> 11 <action android:name="android.intent.action.MAIN" /> 12 13 <category android:name="android.intent.category.LAUNCHER" /> 14 </intent-filter> 15 </activity> 16 </application>
它的默认值;
组件在mainifest.xml中定义时,如果没有 <intent-filter> 那么就是 true
转载于:https://www.cnblogs.com/sjjg/p/4771272.html