【发布时间】:2016-08-06 09:54:39
【问题描述】:
我有一个在后台运行的用于推送通知的 Android 应用服务。 它使用 startService() 调用意图;它在预版本中运行良好,但不适用于棒棒糖。我不知道为什么它不起作用(因为服务意图在棒棒糖中必须是明确的)但是当我试图让它明确的后台服务不起作用时。如何解决它。
这是调用服务的部分工作代码:
主活动
Intent serviceIntent = new Intent("android.intent.action.START_SERVICE");
this.startService(serviceIntent);
清单
<service android:name=".MyService">
<intent-filter>
<action android:name="android.intent.action.START_SERVICE" />
</intent-filter>
</service>
【问题讨论】:
标签: android android-intent android-service android-intentservice explicit-intent