我以这种方式启动 Intent 服务:
Intent MyIntentService = new Intent(this, clsMyIntentService.class);
MyIntentService.putExtra("Command", Command1);
startService(MyIntentService );
....
Sleep and do some work
....
Intent MyIntentService = new Intent(this, clsMyIntentService.class);
MyIntentService.putExtra("Command", Command2);
startService(MyIntentService );
我的问题是 IntentService 在一切都完成之前不会收到任何东西。并且当它开始接收命令时是错误的,因为 Command2 比 Command1 更早被接收(就在之前)。
有什么帮助吗?