服务等待其他服务

时间:2016-03-20 11:40:21

标签: android

我有服务A和B;服务A启动服务B.

服务A:

@Override
public int onStartCommand(Intent intent, int flags, int startId) {
    Intent serviceB = new Intent(this, ServiceB.class);
    startService(serviceB);
    ...
    Toast.makeText(getApplicationContext(),"A",Toast.LENGTH_SHORT).show();
}

服务B:

@Override
public int onStartCommand(Intent intent, int flags, int startId) {
    Toast.makeText(getApplicationContext(),"B",Toast.LENGTH_SHORT).show();
    ...
}

此代码显示Toast A,然后显示Toast B.如何在服务B上的Toast上显示服务A上的Toast?

0 个答案:

没有答案
相关问题