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

标签 android android-intent warnings logcat android-logcat

我在开发时在 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/

相关文章:

android - 触摸特定图像时放大更近的图片

security - Angular 2 : sanitizing HTML stripped some content with div id - this is bug or feature?

function - 在 Lisp 中,如何修复 "Warning: Assumed Special?"

java - 推送示例android gcm,已注册设备但未收到推送通知

android - 如何使表格行适合android中的屏幕宽度

android - Google 的 Messenger 应用程序在发送彩信时未附加图片

java - Android 查看视频文件的隐式 Intent

c - C中的多行注释警告是什么意思?

android - 以编程方式在 TextView 下画线

android - 透明度问题 Samsung Galaxy S3