我有一个Android服务mycompany.service.Agent。这是应用程序中唯一定义的内容。它是“开始”型服务。
我能够在Emulator上构建并安装它就好了。我通过转到设置应用的“管理应用”部分来验证它。
我没有任何活动来启动此服务。 我正尝试从adb shell手动启动它。
启动服务:Intent {act = android.intent.action.VIEW dat = mycompany.service.STARTAGENT} 错误:未找到;没有服务开始。
以下是我的清单文件的副本。 我做错了什么?
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="polycom.service"
android:versionCode="1"
android:versionName="1.0">
<application android:label="@string/app_name" android:icon="@drawable/icon">
<service android:name=".APIAgent" android:exported="true" >
<intent-filter>
<action android:name="mycompany.service.STARTAGENT" />
<action android:name="mycompany.service.STOPAGENT" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</service>
</application>
</manifest>
感谢
视频专家
答案 0 :(得分:3)
这是应该如何调用
我错过了“-a”部分。