问题
I am trying to call an Android service which is stored in an external JAR file into my android application. When I import the JAR in, everything works fine except the service. If I manually copy the service file into the package and give it a new name, it works, but not when calling the same service by the name it's stored as in the JAR. I have included the package path as well when calling the service. Any help is greatly appreciated.
回答1:
You will need to add the service declaration into your manifest even if it is contained in an external jar.
example:
<service android:name="com.whatever.something.SomeService"/>
来源:https://stackoverflow.com/questions/6700546/calling-a-service-from-an-external-jar-in-android