gpt4 book ai didi

android - AppWidget 配置 Activity 的导出 Activity 权限

转载 作者:太空狗 更新时间:2023-10-29 16:22:05 25 4
gpt4 key购买 nike

在我添加 android:exported="true" 标签后,我在 list 文件中收到了 AppWidget 配置 Activity 的警告。这就是它的样子......

<activity android:name=".widgets.WidgetConfigurationActivity"
android:theme="@android:style/Theme.Translucent"
android:exported="true" >
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_CONFIGURE" />
</intent-filter>
</activity>

我收到的警告是“导出的 Activity 不需要许可”。根据我的理解,将 exported 标记设置为 true 意味着与我的应用程序无关的另一个应用程序可以访问它(这是有道理的,因为主屏幕启动器应用程序需要启动我的 AppWidget 的配置 Activity )。有谁知道我需要在此处添加什么样的权限才能使其不出错?

最佳答案

From my understanding, setting the exported tag to true means that another application not related to my app can access it

正确。请注意,它在这里是多余的:有一个 <intent-filter>使 Activity 默认导出。

Does anyone know what kind of permission I need to add here to make this not give an error?

据我所知,您不能保证主屏幕具有任何特定权限。

恕我直言,这是一个错误警告,一个 that I filed a related issue for这应该有一天会被修复。

关于android - AppWidget 配置 Activity 的导出 Activity 权限,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11916590/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com