zoukankan      html  css  js  c++  java
  • Exported activity does not require permission

    问题:

    今天在AndroidManifest.xml文件中配置Activity后,系统提示我“Exported activity does not require permission”。我配置的代码如下:

    <activity android:name="com.example.testmain.ShowActivity" >
                 <intent-filter>
                     <action android:name="test.update.mydata" />
    
                     <category android:name="my.test.show" />
                 </intent-filter>
             </activity>

    原因:

    查了一下资料,原来是因为我给Activity配置了<intent-filter>属性,配置<intent-filter>属性,就意味着这个Activity可以被其他App程序所使用。但是怎么样即配置<intent-filter>属性,有防止被其他App使用呢?这里主要有两个解决办法!

    第一种:

    通过添加android:exported="false"属性。这个属性用于指示该服务是否能够被其他应用程序组件调用或跟它交互。如果设置为true,则能够被调用或交互,否则不能。设置为false时,只有同一个应用程序的组件或带有相同用户ID的应用程序才能启动或绑定该服务。

      <activity
                android:name="com.example.testmain.ShowActivity"
                android:exported="false" >
                <intent-filter>
                    <action android:name="test.update.mydata" />
                    <category android:name="my.test.show" />
                </intent-filter>
         </activity>

    第二种:

    通过添加<permission>权限来控制其他App对服务的访问!

  • 相关阅读:
    论文笔记:SRCNN
    4.2 CNN实例探究
    4.1 卷积神经网络
    3 ML策略
    2.3 超参数调试,batch正则化和程序框架
    2.2 优化算法
    2.1 深度学习的实用层面
    Lecture4 反向传播算法
    Lecture3 神经网络学习
    java基础部分
  • 原文地址:https://www.cnblogs.com/ywtk/p/4159445.html
Copyright © 2011-2022 走看看