Example #1
0
  @Override
  protected void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);
    uiHelper.onSaveInstanceState(outState);

    outState.putString(PENDING_ACTION_BUNDLE_KEY, pendingAction.name());
  }
Example #2
0
 @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();
 }
Example #3
0
  @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);
  }
Example #4
0
  @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();
  }
Example #5
0
 @Override
 protected void onActivityResult(int requestCode, int resultCode, Intent data) {
   super.onActivityResult(requestCode, resultCode, data);
   uiHelper.onActivityResult(requestCode, resultCode, data, dialogCallback);
 }
Example #6
0
 @Override
 public void onDestroy() {
   super.onDestroy();
   uiHelper.onDestroy();
 }
Example #7
0
 @Override
 protected void onStart() {
   // TODO Auto-generated method stub
   super.onStart();
 }