跳至主要内容

博文

目前显示的是标签为“service”的博文

android bindService无法启动或不运行的问题 (

即在TabActivy的TabHost中的Activity如果需要bindService的话,需要先调用getApplicationContext()获取其所属的Activity的上下文环境才能正常bindService,也就是在onCreate()方法中使用this.getApplicationContext().bindService([args…])就可以了,否则bindService将永远失败返回false,remote service 返回也为null。