我創建了一個名爲LocalService的服務,我想綁定到它,以便它可以執行某些操作並將結果返回給調用客戶端。我一直試圖讓example of the android dev site的工作,但月食給出了這種方法的編譯時錯誤:在Android中綁定服務的問題
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」之下,日食給我:綁定不能被解析爲一種。我能做什麼?