intent.setPackage("lq.cn.Service4");
上面这一句如果不加,会出错,提示Serviceintent must be explicit
加上这句运行也不对。
@Override
public void onCreate() {
System.out.println("---onCreate---");
super.onCreate();
}
@Override
public IBinder onBind(Intent intent) {
// TODO Auto-generated method stub
System.out.println("---onBind---");
return null;
}
@Override
public boolean onUnbind(Intent intent) {
System.out.println("---onUnbind---");
return super.onUnbind(intent);
}
@Override
public void onDestroy() {
System.out.println("---onDestroy---");
super.onDestroy();
}