@Override protected void onDestroy() { LogUtil.d("WeChat", "onDestroy"); super.onDestroy(); if (msgBinder != null) { LogUtil.d("service", "binder.close()"); msgBinder.close(); } unbindService(serviceConnection); // TODO:if need stopService? }
@Override public void onServiceConnected(ComponentName name, IBinder service) { msgBinder = (MsgService.MsgBinder) service; msgBinder.connectServer(); }