我创建了一个名为LocalService的服务,并希望绑定它,以便它可以执行某些操作并将结果返回给调用客户端。我一直在尝试让安卓开发网站上的示例正常工作,但是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给出了以下提示信息:“Binding cannot be resolved to a type”。我该怎么办?