我想以静态方式启动服务。所以从我的活动我打电话onCreate android服务不叫
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"/>
为什么服务没有启动任何想法?
是的,我要问他是否真的用Intent做了什么...... – dmon 2013-02-14 14:55:45