7
ERROR:CursorWrapperInner(10908):沒有事先關閉()Facebook的Android的碎片登錄
我一直試圖讓Facebook的代碼與我的應用程序工作完成光標。由於某些原因,即使樣本也會出現這個錯誤?我不知道爲什麼,但這裏是我的片段,我得到了上述同樣的錯誤。
代碼:
package com.fragments;
public class MainDisplayFragment extends Fragment {
private static final String TAG = "MainFragment";
private UiLifecycleHelper uiHelper;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
View view = inflater.inflate(R.layout.main_display_fragment, container,
false);
uiHelper = new UiLifecycleHelper(this.getActivity(), callback);
uiHelper.onCreate(savedInstanceState);
// Facebook login button.
LoginButton authButton = (LoginButton) view
.findViewById(R.id.authButton);
authButton.setFragment(this);
// Set Application ID.
authButton.setReadPermissions(Arrays.asList("user_friends",
"user_about_me", "user_birthday", "user_likes", "user_status"));
return view;
}
private void onSessionStateChange(Session session, SessionState state,
Exception exception) {
if (state.isOpened()) {
Log.i(TAG, "Logged in...");
} else if (state.isClosed()) {
Log.i(TAG, "Logged out...");
}
}
private Session.StatusCallback callback = new Session.StatusCallback() {
@Override
public void call(Session session, SessionState state,
Exception exception) {
onSessionStateChange(session, state, exception);
}
};
@Override
public void onResume() {
super.onResume();
uiHelper.onResume();
}
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
uiHelper.onActivityResult(requestCode, resultCode, data);
}
@Override
public void onPause() {
super.onPause();
uiHelper.onPause();
}
@Override
public void onDestroy() {
super.onDestroy();
uiHelper.onDestroy();
}
@Override
public void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
uiHelper.onSaveInstanceState(outState);
}
}
你試過內活動代碼?這個是來做什麼的? 'authButton.setFragment(this);'你是否嘗試過用於檢索用戶狀態的共享首選項?有沒有可能'callback'爲它們中的任何一個返回空值? –
我已經有一段時間在你的評論之前修復了,我很抱歉沒有更快發佈。看下面的所有類似的問題。 – thekevshow