我想以静态方式启动服务。所以从我的活动中我打电话给
SpeechActivationService.makeStartServiceIntent(
this.getApplicationContext(),
"WordActivator");
这是从服务类http://dpaste.com/hold/928115/扩展的实际类如您所见,有几个日志点,例如在 onCreate 方法中。
这没有记录。只有当我将日志文本放入makeStartServiceIntent
方法中时,它才会出现,但不会出现在onCreate
方法中。
这是makeStartServiceIntent
方法:
public static Intent makeStartServiceIntent(Context context,
String activationType) {
Intent i = new Intent(context, SpeechActivationService.class);
i.putExtra(ACTIVATION_TYPE_INTENT_KEY, activationType);
return i;
}
在清单文件中我有
<service android:name="root.gast.speech.activation.SpeechActivationService"/>
任何想法为什么服务没有启动?