关于TabActivity中bindService的使用

在TabActivity中bindService中应该这样bind

 Intent intent = new Intent(this, MyService.class);
        this.getApplicationContext().bindService(intent, mConnect, Context.BIND_AUTO_CREATE);
在销毁时,也要注意

 @Override
    protected void onDestroy() {
        super.onDestroy();
        this.getApplicationContext().unbindService(mConnect);
    }



猜你喜欢

转载自blog.csdn.net/mapeifan/article/details/52326837