我從Facebook的文件here如何覆蓋上activityResult在android系統
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
uiHelper.onActivityResult(requestCode, resultCode, data, new FacebookDialog.Callback() {
// @Override
public void onError(FacebookDialog.PendingCall pendingCall, Exception error, Bundle data) {
Log.e("Activity", String.format("Error: %s", error.toString()));
}
@Override
public void onComplete(FacebookDialog.PendingCall pendingCall, Bundle data) {
Log.i("Activity", "Success!");
}
});
}
得到這個代碼,並把它在MainActivity,但日食給出錯誤:The method onComplete(FacebookDialog.PendingCall, Bundle) of type new FacebookDialog.Callback(){} must override or implement a supertype method
和The method onComplete(FacebookDialog.PendingCall, Bundle) of type new FacebookDialog.Callback(){} must override or implement a supertype method
等,爲什麼呢?
當您刪除@Override時會發生什麼? – Arno