|
Receiver的onReceive()方法:
public void onReceive(Context context, Intent intent) {
Log.i("=====Receiver=======","===== onReceive starts===="); ----- (1)
intent.setClass(context, AService.class);
context.startService(intent);
Log.i("=====Receiver=======","===== onReceive ends===="); -------(2)
}
Service的onCreate()方法:
public void onCreate(){ Log.i("=======Service========", "========OnCreate()=== "); ----- (3)
-- some logic here
}
为什么打印的顺序是(1)(2)(3),也就是说onCreate()方法是onRecieve()方法执行完成之后,才会被执行???
请高人解答。。。 |
|