title: Facebook connect 3.5 Session: an attempt was made to open an already opened session
body: <p>When i click on fbconnect below :</p>
  
  <pre><code>fbconnect.setOnClickListener(new OnClickListener() {
  
      @Override
      public void onClick(View v) {
          // Check for an open session
  
          /*Session session = Session.getActiveSession();
  
          if (!session.isOpened() &amp;&amp; !session.isClosed()) {
              System.out.println("hereinfb");
              session.openForRead(new Session.OpenRequest(getActivity())
                      .setCallback(callback).setPermissions(
                              Arrays.asList("basic_info", "email",
                                      "user_photos")));
              ;
  
              fbconnect(session);
  
          } else {
              System.out.println("hereinfb1");
              Session.openActiveSession(getActivity(), true, callback);
  
              fbconnect(session);
  
          }*/
  
  
          session = Session.getActiveSession();
  
          session.openForRead(new Session.OpenRequest(m).setCallback(
                  callback).setPermissions(
                  Arrays.asList("basic_info", "email", "user_photos")));
  
          Session.openActiveSession(getActivity(), true, callback);
  
          System.out.println("fbsession" + session);
  
          if (session != null) {
              // Get the user's data
  
              fbconnect(session);
  
          }
  
          /*
           * 
           * Session session = Session.getActiveSession();
           * System.out.println("fbsession" + session); if (session !=
           * null) { // Get the user's data fbconnect(session); }else {
           * 
           * fbconnect(session);
           * 
           * }
           */
  
      }
  });
  </code></pre>
  
  <p>The application force close and error log says:</p>
  
  <pre><code>04-03 14:14:14.164: E/AndroidRuntime(29386): FATAL EXCEPTION: main
  04-03 14:14:14.164: E/AndroidRuntime(29386): java.lang.UnsupportedOperationException: Session: an attempt was made to open an already opened session.
  04-03 14:14:14.164: E/AndroidRuntime(29386):    at com.facebook.Session.open(Session.java:985)
  04-03 14:14:14.164: E/AndroidRuntime(29386):    at com.facebook.Session.openForRead(Session.java:388)
  04-03 14:14:14.164: E/AndroidRuntime(29386):    at com.orange.re.SlidingMenuFragment$3.onClick(SlidingMenuFragment.java:123)
  04-03 14:14:14.164: E/AndroidRuntime(29386):    at android.view.View.performClick(View.java:4475)
  04-03 14:14:14.164: E/AndroidRuntime(29386):    at android.view.View$PerformClick.run(View.java:18786)
  04-03 14:14:14.164: E/AndroidRuntime(29386):    at android.os.Handler.handleCallback(Handler.java:730)
  04-03 14:14:14.164: E/AndroidRuntime(29386):    at android.os.Handler.dispatchMessage(Handler.java:92)
  04-03 14:14:14.164: E/AndroidRuntime(29386):    at android.os.Looper.loop(Looper.java:137)
  04-03 14:14:14.164: E/AndroidRuntime(29386):    at android.app.ActivityThread.main(ActivityThread.java:5419)
  04-03 14:14:14.164: E/AndroidRuntime(29386):    at java.lang.reflect.Method.invokeNative(Native Method)
  04-03 14:14:14.164: E/AndroidRuntime(29386):    at java.lang.reflect.Method.invoke(Method.java:525)
  04-03 14:14:14.164: E/AndroidRuntime(29386):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1187)
  04-03 14:14:14.164: E/AndroidRuntime(29386):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
  04-03 14:14:14.164: E/AndroidRuntime(29386):    at dalvik.system.NativeStart.main(Native Method)
  </code></pre>
  
  <p>This line crash the application.</p>
  
  <pre><code>session.openForRead(new Session.OpenRequest(m).setCallback(
                          callback).setPermissions(
                          Arrays.asList("basic_info", "email", "user_photos")));
  </code></pre>