日期:2014-05-20  浏览次数:20742 次

android 关于服务连接的疑问
已建立IMediaPlayService.aidl ,。。。有:boolean  flag =  this.bindService (mintent, serviceConn, Context.BIND_AUTO_CREATE);
                         if ( flag){
                                 Log.i("system","**************** bindService  is successful******");//这句输出了
         
                         }else {
                                 Log.i("system","**************** bindService  is failed ******");
                                  
                         }

private ServiceConnection serviceConn = new ServiceConnection() {

                  @Override
                  public void onServiceDisconnected(ComponentName name) {
                           Log.i("system","=========onServiceDisConnected==========");
               mservice =null;
                   }

                  @Override
                  public void onServiceConnected(ComponentName name, IBinder service) {
                         
                   mservice= IMediaPlaybackService.Stub.asInterface(service);
                   Log.i("system","=========onServiceConnected==========");
                  
                  }
                 };
绑定服务 log显示绑定成功,但mservice 是空的 不知为何,?求指点
------解决方案--------------------
public void onServiceConnected(ComponentName name, IBinder service) 这个函数也没执行,怎么回事啊
------解决方案--------------------
结束了。。。。。。。