title: Sharing on facebook without the native app installed
body: <p>I'm trying to share some stuff on Facebook. following this <a href="https://developers.facebook.com/docs/android/share#prerequisites" rel="nofollow">guide</a> I managed to complete the sharing when you have the native app. However, when I reached this:</p>
  
  <p>Step 4: Using the Feed Dialog as fallback. It says that to be able to use a fallback method, I need to add the code below</p>
  
  <pre><code>private void publishFeedDialog() {
      Bundle params = new Bundle();
      params.putString("name", "Facebook SDK for Android");
      params.putString("caption", "Build great social apps and get more installs.");
      params.putString("description", "The Facebook SDK for Android makes it easier and faster to develop Facebook integrated Android apps.");
      params.putString("link", "https://developers.facebook.com/android");
      params.putString("picture", "https://raw.github.com/fbsamples/ios-3.x-howtos/master/Images/iossdk_logo.png");
  
      WebDialog feedDialog = (
          new WebDialog.FeedDialogBuilder(getActivity(),
              Session.getActiveSession(),
              params))
          .setOnCompleteListener(new OnCompleteListener() {
  
              @Override
              public void onComplete(Bundle values,
                  FacebookException error) {
                  if (error == null) {
                      // When the story is posted, echo the success
                      // and the post Id.
                      final String postId = values.getString("post_id");
                      if (postId != null) {
                          Toast.makeText(getActivity(),
                              "Posted story, id: "+postId,
                              Toast.LENGTH_SHORT).show();
                      } else {
                          // User clicked the Cancel button
                          Toast.makeText(getActivity().getApplicationContext(), 
                              "Publish cancelled", 
                              Toast.LENGTH_SHORT).show();
                      }
                  } else if (error instanceof FacebookOperationCanceledException) {
                      // User clicked the "x" button
                      Toast.makeText(getActivity().getApplicationContext(), 
                          "Publish cancelled", 
                          Toast.LENGTH_SHORT).show();
                  } else {
                      // Generic, ex: network error
                      Toast.makeText(getActivity().getApplicationContext(), 
                          "Error posting story", 
                          Toast.LENGTH_SHORT).show();
                  }
              }
  
          })
          .build();
      feedDialog.show();
  }
  </code></pre>
  
  <p>After adding this, I get errors at <code>getActivity()</code>, I fix this by using <code>MyClass.this</code>.
  Then, when I run the app (I directly run this method at startup) my application crashes and I get some error like "attempted to use session that was not open"</p>
  
  <p>Anyone know how to be able to share stuff without the native app installed?</p>