gpt4 book ai didi

android - 我总是在 android 7 中看到 "E ActivityManager: Sending non-protected broadcast from system"。这是什么意思?

转载 作者:太空狗 更新时间:2023-10-29 14:43:45 25 4
gpt4 key购买 nike

我正在尝试使用以下函数从非系统应用程序发送 Intent 。

public static void sendIntent() {
if (null != _context) {
Intent intent = new Intent("com.test.testApp.testIntent");
intent.setPackage(_context.getPackageName());
_context.sendBroadcast(intent);
}
}

但我总是看到来自 ActivityManager 的错误消息如下。同样的 intent broadcasting(app) 在 andorid 6.0 中工作正常,但在 android 7.1.1 中抛出错误。我需要为 android 7.1.1 更改任何内容吗?

4-10 15:06:34.423 1615 2921 E ActivityManager:从系统 2886:com.test.testApp/u0a117 pkg com.test.testApp 发送不 protected 广播 com.test.testApp.testIntent

在 ListFragment 中,我按如下方式注册接收器:

 @Override
public void onStart() {
super.onStart();
getActivity().registerReceiver((receiver),
new IntentFilter(com.test.testApp.testIntent));
TextView textDownload = (TextView) getActivity().findViewById(R.id.output);
textDownload.setVisibility(android.view.View.INVISIBLE);
}

最佳答案

这可能有帮助,

如果您在 AndroidManifest.xml 中声明了“android:sharedUserId="android.uid.system”,则声明 protected 广播。

引用:https://stackoverflow.com/a/50240471

关于android - 我总是在 android 7 中看到 "E ActivityManager: Sending non-protected broadcast from system"。这是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43354717/

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