I get this warning in Logcat while developing. Is it caused by my app?
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
I can't see where I could be causing this in my code.
An implicit intent specifies an action that can invoke any app on the device able to perform the action. Using an implicit intent is useful when your app cannot perform the action, but other apps probably can and you'd like the user to pick which app to use.
An intent allows you to start an activity in another app by describing a simple action you'd like to perform (such as "view a map" or "take a picture") in an Intent object.
Intents are used to signal to the Android system that a certain event has occurred. Intents often describe the action which should be performed and provide data upon which such an action should be done. For example, your application can start a browser component for a certain URL via an intent.
It is possible to start an app's activity by using Intent. setClassName according to the docs. To open it outside the current app, add this flag before starting the intent.
http://developer.android.com/reference/android/content/Intent.html
Intent Resolution
There are two primary forms of intents you will use.
Explicit Intents have specified a component (via setComponent(ComponentName) or setClass(Context, Class)), which provides the exact class to be run. Often these will not include any other information, simply being a way for an application to launch various internal activities it has as the user interacts with the application. Implicit Intents have not specified a component; instead, they must include enough information for the system to determine which of the available components is best to run for that intent. When using implicit intents, given such an arbitrary intent we need to know what to do with it. This is handled by the process of Intent resolution, which maps an Intent to an Activity, BroadcastReceiver, or Service (or sometimes two or more activities/receivers) that can handle it.
May be its saying to mention the component explicitly.
I faced exactly the same problem and it seems to be that in the Google Play Services Library, they missed to put android:exported="true"
in their <service>
declaration.
Before Android 5.0, it was allowed to start services with implicit intents, but now it's not possible, and instead of having a warning, you will have an Exception.
They need to fix their stuff.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With