今天在座shortcut的demo时,发现加不加android:exported="true",都能被第三方的launcher进行调用,结果就查了下,发现:

android:exported
Whether or not the activity can be launched by components of other applications — " true" if it can be, and " false" if not. If " false", the activity can be launched only by components of the same application or applications with the same user ID.

The default value depends on whether the activity contains intent filters. The absence of any filters means that the activity can be invoked only by specifying its exact class name. This implies that the activity is intended only for application-internal use (since others would not know the class name). So in this case, the default value is "false". On the other hand, the presence of at least one filter implies that the activity is intended for external use, so the default value is "true".

This attribute is not the only way to limit an activity's exposure to other applications. You can also use a permission to limit the external entities that can invoke the activity (see thepermissionattribute).

default value的值是根据是否有<intent-filter>来决定的,有的话,默认值就是true,没有的话默认值就是false;两者都有的话,就以android:exported为准。

更多相关文章

  1. Android 内存剖析 – 发现潜在问题
  2. Android tips tool 发现的性能问题
  3. 对TextView ImageView 设置了drawable selector 发现不管用问题
  4. android发现之旅之媒体按键(耳机按键播放暂停键等)处理过程
  5. Android 小发现:xml里定义的组件取出始终为null
  6. Android开发现状分析(2020版)
  7. 注册中心 Eureka源码解析 —— 应用实例注册发现 (九)之岁月是把萌
  8. 注册中心 Eureka 源码解析 —— 应用实例注册发现(一)之注册
  9. 注册中心 Eureka 源码解析 —— 应用实例注册发现(七)之增量获取

随机推荐

  1. 多线程下载测试TestDownload
  2. TextView获取行数
  3. Android(安卓)技术总结(016)—— 使用百度
  4. 测试手机多点触摸
  5. 【Android】判断某个App是否安装并启动(qu
  6. 创建文件并进行读写
  7. android广播 demo
  8. BroadcastReceiver
  9. Android多个MenuItem如何互斥
  10. Android(安卓)ListView使用方法