title: Fixing .android folder facebook sdk mess?
body: <p>I have pretty serious problem on which I've been stuck for almost 2 weeks. I am not sure where the mistake is so I am planning to deleting everything related to Facebook SDK. </p>
  
  <p>However I am unsure what else is in the .android folder. The contents of it are: </p>
  
  <p><img src="https://i.stack.imgur.com/r1EvS.png" alt=".android folder"></p>
  
  <p>Can I just delete the facebook projects from within the eclipse and clear that folder and start again?</p>
  
  <p>When I was creating the debug key I entered my own password and not "android" so it caused additional problems. I failed to find any help on how to change the password or what to do to generate new one. I tried deleting debug.keystore file, but the problem persists. Any help greatly appreciated. </p>
  
  <p>Lastly does anybody know where I could find some recent <a href="https://developers.facebook.com/docs/android/login-with-facebook/" rel="nofollow noreferrer">Facebook login tutorials</a>, following the one on Facebook page leads to the following problems:</p>
  
  <p><img src="https://i.stack.imgur.com/7d0VT.png" alt="facebook prob"></p>
  
  <p>The full code for the two classes is as follows:</p>
  
  <pre><code>import java.util.Arrays;
  
  import android.content.Intent;
  import android.os.Bundle;
  import android.support.v4.app.Fragment;
  import android.util.Log;
  
  import com.facebook.Session;
  import com.facebook.SessionState;
  import com.facebook.UiLifecycleHelper;
  import com.facebook.widget.LoginButton;
  
  public class FBMainFragment extends Fragment{
  private static final String TAG = "MainFragment";
  private UiLifecycleHelper uiHelper;
  
  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 onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      uiHelper = new UiLifecycleHelper(getActivity(), callback);
      uiHelper.onCreate(savedInstanceState);
      LoginButton authButton = (LoginButton) view.findViewById(R.id.authButton);
      authButton.setFragment(this);
      authButton.setReadPermissions(Arrays.asList("user_likes", "user_status"));
  
      return view;
  }
  @Override
  public void onResume() {
      super.onResume();
   // For scenarios where the main activity is launched and user
      // session is not null, the session state change notification
      // may not be triggered. Trigger it if it's open/closed.
      Session session = Session.getActiveSession();
      if (session != null &amp;&amp;
             (session.isOpened() || session.isClosed()) ) {
          onSessionStateChange(session, session.getState(), null);
      }
  
      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);
  }
  }
  </code></pre>
  
  <p>and: </p>
  
  <pre><code>import android.os.Bundle;
  import android.support.v4.app.FragmentActivity;
  import android.view.Menu;
  
  public class FacebookLogIn extends FragmentActivity {
  
  private FBMainFragment mainFragment;
  // Your Facebook APP ID
  private static String applicationId = "308180782571605"; // Replace your App ID here
  private static final String TAG = "FBMainFragment";
  
  @Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
  
      if (savedInstanceState == null) {
          // Add the fragment on initial activity setup
          mainFragment = new FBMainFragment();
          getSupportFragmentManager()
          .beginTransaction()
          .add(android.R.id.content, mainFragment)
          .commit();
      } else {
          // Or set the fragment from restored state info
          mainFragment = (FBMainFragment) getSupportFragmentManager()
          .findFragmentById(android.R.id.content);
  
      }
  
  }
  
  
  @Override
  public boolean onCreateOptionsMenu(Menu menu) {
      // Inflate the menu; this adds items to the action bar if it is present.
      getMenuInflater().inflate(R.menu.facebook_log_in, menu);
      return true;
  }
  
  
  public static String getTag() {
      return TAG;
  }
  
  
  public static String getApplicationId() {
      return applicationId;
  }
  
  
  public static void setApplicationId(String applicationId) {
      FacebookLogIn.applicationId = applicationId;
  }
  
  }
  </code></pre>