我创建了一个名为 LocalService 的服务,我想绑定到它,以便它可以执行一些操作并将结果返回给调用客户端。我一直在尝试让android dev 站点的示例正常工作,但 eclipse 在此方法上给出了编译时错误:
void doBindService() {
// Establish a connection with the service. We use an explicit
// class name because we want a specific service implementation that
// we know will be running in our own process (and thus won't be
// supporting component replacement by other applications).
bindService(new Intent(Binding.this, LocalService.class), mConnection, Context.BIND_AUTO_CREATE);
mIsBound = true;
}
“Binding.this”下有一条红线,eclipse给了我:无法将绑定解析为类型。我能做些什么?