Google Android Issue中有这个缺陷,缺陷详细信息在这里(Google Android Issue 2483),
Using getApplicationContext().bindService instead of just bindService on your activity solves the problem as it is using the higher level application context.
先调用getApplicationContext()获取其所属的Activity的上下文环境才能正常bindService,
也就是在onCreate()方法中使用this.getApplicationContext().bindService([args…])就可以了,否则bindService将永远失败返回false。
Using getApplicationContext().bindService instead of just bindService on your activity solves the problem as it is using the higher level application context.
先调用getApplicationContext()获取其所属的Activity的上下文环境才能正常bindService,
也就是在onCreate()方法中使用this.getApplicationContext().bindService([args…])就可以了,否则bindService将永远失败返回false。