您的位置:首页 > 其它

禁止从别的应用启动Activity

2016-09-16 16:46 246 查看
在Manifest.xml中设置android:exported="false"即可,如:

<activity android:name=".MyAty" android:exported="false">
<intent-filter>
<category android:name="android.intent.category.DEFAULT"/>
<action android:name="com.example.administrator.learnintent.action.myaty"/>
</intent-filter>
</activity>

android:exported 是Android中的四大组件 Activity,Service,Provider,Receiver 四大组件中都会有的一个属性。

总体来说它的主要作用是:是否支持其它应用调用当前组件。
默认值:如果包含有intent-filter 默认值为true; 没有intent-filter默认值为false。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: