调用Intent Service的操作

时间:2015-11-03 10:34:46

标签: android android-intent android-service adb intentfilter

我刚刚在Android Studio中创建了一个新的intentService应用程序,我对如何调用它感到困惑。

它是否仅用于显式调用另一个应用程序? 我不能在清单中声明一个intent过滤器,然后让它响应广播意图吗?

例如, 我有一个像这样的意图过滤器

<service
        android:name=".RemoteShopKeyService"
        android:enabled="true"
        android:exported="true" >
        <intent-filter>
            <action android:name="com.srini.remoteshopservice.action.FOO" />
        </intent-filter>
    </service>

在Main服务类中,我处理意图。但是,如何通过adb使用android.intent.action.MAIN以外的操作调用服务?

我使用adb shell am startservice

启动服务

0 个答案:

没有答案