2015-06-20 56 views
0

我試圖重新添加打到我googleApiClientaddConnectionCallbacks無法添加回調:不能轉換到ConnectionCallbacks

mPlusClient = new GoogleApiClient.Builder(this).addConnectionCallbacks(this).addOnConnectionFailedListener(this).addApi(Plus.API).addScope(Plus.SCOPE_PLUS_LOGIN).build(); 

,但我得到這個錯誤:

Error:(85, 81) error: incompatible types: PlusBaseActivity cannot be converted to ConnectionCallbacks

我從一個在線教程中獲得這些代碼,但它似乎不起作用,請幫助。

回答

2

我對你在做什麼沒有任何經驗,但可能是PlusBaseActivity類必須實現ConnectionCallbacks才能成爲回調?喜歡:

public class PlusBaseActivity extends Activity implements ConnectionCallbacks{ 
// add ConnectionCallBack methods 
} 
+0

如果你想了解更多關於繼承的信息,請閱讀這個偉大的[指南](http://www.tutorialspoint.com/java/java_jaher_inheritance.htm) – TmKVU

相關問題