public class BinderService extends Service
{
private MyBinder binder =new MyBinder();
public class MyBinder extends Binder
{
public BinderService getService()
{
return BinderService.this;
}
}
}
请帮忙把这段代码解释一下 return BinderService.this; private MyBinder binder =new MyBinder();
------解决方案--------------------
BinderService.this是对App的Context引用
private MyBinder binder =new MyBinder()创建了一个内部类的对象