gpt4 book ai didi

android - 这个警告是由我的应用程序引起的吗? - "Implicit intents with startService are not safe"

转载 作者:IT老高 更新时间:2023-10-28 23:34:51 26 4
gpt4 key购买 nike

我在开发时在 Logcat 中收到此警告。是我的应用造成的吗?

16699-16699/tld.me.myapp.debug W/ContextImpl﹕ Implicit intents with startService are not safe: Intent { act=com.google.android.location.internal.GoogleLocationManagerService.START } android.content.ContextWrapper.bindService:517 com.google.android.gms.internal.v.a:-1 com.google.android.gms.internal.u.connect:-1

我看不出在我的代码中可能是什么原因造成的。

最佳答案

http://developer.android.com/reference/android/content/Intent.html

Intent 解析

您将使用两种主要形式的 Intent 。

Explicit Intents 指定了一个组件(通过 setComponent(ComponentName) 或 setClass(Context, Class)),它提供了要运行的确切类。通常这些不会包含任何其他信息,只是作为应用程序在用户与应用程序交互时启动其具有的各种内部 Activity 的一种方式。隐式 Intent 没有指定组件;相反,它们必须包含足够的信息,以便系统确定哪些可用组件最适合为该 Intent 运行。当使用隐式 Intent 时,给定这样一个任意 Intent ,我们需要知道如何处理它。这由 Intent 解析过程处理,该过程将 Intent 映射到可以处理它的 Activity、BroadcastReceiver 或 Service(有时是两个或多个 Activity/接收器)。

可能是明确提及组件。

关于android - 这个警告是由我的应用程序引起的吗? - "Implicit intents with startService are not safe",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22050813/

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