禁止从别的应用启动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。
相关文章推荐
- Android在一个应用中启动另一个应用的Activity时失败的解决办法
- 禁止横屏和竖屏切换,竖屏后横屏防止再次启动activity
- Android应用开发学习之启动另外一个Activity
- 【Android Developers Training】 30. 允许其它应用启动你的Activity
- App应用之启动界面SplashActivity
- activity 根据包名和应用名启动应用程序
- Android 进阶 - Activity应用启动分析
- Android开机启动Service或Activity或应用
- Android在一个应用中启动另一个应用的Activity的办法
- Activity的启动模式_打开其它应用中的Activity
- Android利用activity启动模式退出整个应用
- 应用窗口activity的启动过程
- Android学习系列(35)--App应用之启动界面SplashActivity
- Android应用开发学习笔记之启动另外一个Activity
- activity启动之应用侧分析
- Android应用点击HOME后,再次启动该应用,不显示最近Activity的问题解决。
- Android开发——通过广播启动另一个应用的Activity
- Android利用activity启动模式退出整个应用
- android应用启动画面+activity动画
- android--通过广播启动另一个应用的Activity