@Override protected void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); uiHelper.onSaveInstanceState(outState); outState.putString(PENDING_ACTION_BUNDLE_KEY, pendingAction.name()); }
@Override protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); setContentView(R.layout.activity_login); uiHelper = new UiLifecycleHelper(this, callback); uiHelper.onCreate(savedInstanceState); if (savedInstanceState != null) { String name = savedInstanceState.getString(PENDING_ACTION_BUNDLE_KEY); pendingAction = PendingAction.valueOf(name); } loginButton = (LoginButton) findViewById(R.id.login_button); loginButton.setReadPermissions( Arrays.asList("public_profile", "email", "user_likes", "user_status")); loginButton.setUserInfoChangedCallback( new LoginButton.UserInfoChangedCallback() { @Override public void onUserInfoFetched(GraphUser user) { LoginActivity.this.user = user; updateUI(); // It's possible that we were waiting for this.user to // be populated in order to post a // status update. handlePendingAction(); } }); init(); }
@Override public void onPause() { super.onPause(); uiHelper.onPause(); AppEventsLogger.deactivateApp(this); // Call the 'deactivateApp' method to log an app event for use in // analytics and advertising // reporting. Do so in the onPause methods of the primary Activities // that an app may be launched into. AppEventsLogger.deactivateApp(this); }
@Override protected void onResume() { // TODO Auto-generated method stub super.onResume(); AppEventsLogger.activateApp(this); uiHelper.onResume(); // Call the 'activateApp' method to log an app event for use in // analytics and advertising reporting. Do so in // the onResume methods of the primary Activities that an app may be // launched into. AppEventsLogger.activateApp(this); updateUI(); }
@Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); uiHelper.onActivityResult(requestCode, resultCode, data, dialogCallback); }
@Override public void onDestroy() { super.onDestroy(); uiHelper.onDestroy(); }
@Override protected void onStart() { // TODO Auto-generated method stub super.onStart(); }