title: get parent activity in fragment
body: <p>I am working with the Facebook SDK and I am facing a Problem. The FacebookLoginFragment is overlaying my Login Activity. In fact, I kind of know the answer why it is, but I'm working now for hours on a solution.</p>
  
  <p>I need the view in the onCreateView method, but if I inflate it, it is just an overlay to my activity_login. How can i <strong>get the correct view without inflating</strong> it? </p>
  
  <p>Please see the code below.</p>
  
  <h3>Login extends FragmentActivity</h3>
  
  <pre><code>protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_login);
  
      //get editText Views
      editTextlogin = (EditText) findViewById(R.id.editText_login);
      editTextpasswd = (EditText) findViewById(R.id.editText_passwd);
  
      if (savedInstanceState == null) {
          // add the fragment on initial activity setup
          mainFragment = new FacebookLoginFragment();
          getSupportFragmentManager().beginTransaction()
                  .add(android.R.id.content, mainFragment).commit();
      } else {
          // or set the fragment from restored state info
          mainFragment = (FacebookLoginFragment) getSupportFragmentManager()
                  .findFragmentById(android.R.id.content);
      }
  
  }
  </code></pre>
  
  <h3>FacebookLoginFragment extends Fragment</h3>
  
  <pre><code>@Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      uiHelper = new UiLifecycleHelper(getActivity(), callback);
      uiHelper.onCreate(savedInstanceState);
      con = new FacebookConnection();
  }
  
  @Override
  public View onCreateView(LayoutInflater inflater, ViewGroup container,
          Bundle savedInstanceState) {
  
      View view = inflater.inflate(R.layout.activity_login, container, false);
  
      // The results of the authentication are returned to the activity, to
      // get the Fragment to receive it
      // call the setFragment() method
      LoginButton authButton = (LoginButton) view
              .findViewById(R.id.authButton);
      authButton.setFragment(this);
      if (Session.getActiveSession().isClosed()) {
          authButton.setReadPermissions("user_status", "email", "publish_actions");
      }
  
      return view;
  }
  </code></pre>
  
  <h3>activity_login</h3>
  
  <p>(I know the relative layout isn't best practice, it was just for testing)</p>
  
  <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:tools="http://schemas.android.com/tools"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:paddingBottom="@dimen/activity_vertical_margin"
  android:paddingLeft="@dimen/activity_horizontal_margin"
  android:paddingRight="@dimen/activity_horizontal_margin"
  android:paddingTop="@dimen/activity_vertical_margin"
  tools:context="at.ts_company.activity.Login" &gt;
  
  &lt;View
      android:id="@+id/view1"
      android:layout_width="fill_parent"
      android:layout_height="1dp"
      android:layout_centerInParent="true"
      android:background="@color/primary_material_light" /&gt;
  
  &lt;EditText
      android:id="@+id/editText_login"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_alignParentTop="true"
      android:layout_centerHorizontal="true"
      android:layout_marginTop="108dp"
      android:ems="10"
      android:hint="@string/login_loginname"
      android:inputType="text" &gt;
  
      &lt;requestFocus /&gt;
  &lt;/EditText&gt;
  
  &lt;EditText
      android:id="@+id/editText_passwd"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_below="@+id/editText_login"
      android:layout_centerHorizontal="true"
      android:ems="10"
      android:hint="@string/login_passwd" 
      android:inputType="textPassword"/&gt;
  
  &lt;ImageView
      android:id="@+id/imageView1"
      android:layout_width="100dp"
      android:layout_height="100dp"
      android:layout_centerHorizontal="true"
      android:adjustViewBounds="true"
      android:contentDescription="@string/logo"
      android:scaleType="fitCenter"
      android:src="@drawable/final_logo" /&gt;
  
  &lt;TextView
      android:id="@+id/textView_createAccount"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_alignParentBottom="true"
      android:layout_centerHorizontal="true"
      android:layout_marginBottom="68dp"
      android:text="@string/login_createAccount" 
      android:clickable="true"
      android:onClick="register"/&gt;
  
  &lt;Button
      android:id="@+id/button_login"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_below="@+id/editText_passwd"
      android:layout_centerHorizontal="true"
      android:drawableLeft="@drawable/arrow_right"
      android:text="@string/login_loginbutton" 
      android:onClick="login"/&gt;
  
  &lt;com.facebook.widget.LoginButton
      android:id="@+id/authButton"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_above="@+id/textView_createAccount"
      android:layout_alignLeft="@+id/editText_passwd"
      android:layout_marginBottom="40dp" /&gt;
  </code></pre>
  
  <p></p>