Activity ActionBar is invisible in fragment
<p>I have problem with ActionBar in my fragment. It's invisible in it, so I can't execute <code>getActionBar().setDisplayHomeAsUpEnabled(true);</code> in my <code>SignUpActivity.java</code>. In every other Activity (not Fragment) it's visible.</p>

<p>Could You tell me what I am doing wrong? Probably something is missing.</p>

<p><strong>fragment_sign_up.xml</strong></p>

<pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="fill_parent"
xmlns:tools="http://schemas.android.com/tools"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
tools:context="com.msh.organizer.SignUpActivity"&gt;

&lt;EditText
    android:layout_below="@id/toolbar"
android:id="@+id/nickname_et"
    android:hint="@string/nickname"
    android:layout_marginTop="40dp"
android:layout_width="match_parent"
android:layout_height="wrap_content" /&gt;

&lt;EditText
    android:id="@+id/email_et"
    android:hint="@string/mail"
    android:layout_marginTop="5dp"
    android:layout_below="@id/nickname_et"
    android:layout_width="match_parent"
    android:layout_height="wrap_content" /&gt;

&lt;EditText
    android:id="@+id/password_et"
    android:hint="@string/password"
    android:inputType="textPassword"
    android:layout_marginTop="5dp"
    android:layout_below="@id/email_et"
    android:layout_width="match_parent"
    android:layout_height="wrap_content" /&gt;

&lt;Button
    android:id="@+id/sign_up_btn"
    android:layout_marginTop="15dp"
    android:layout_below="@id/password_et"
    android:text="@string/sign_up"
    android:layout_width="match_parent"
    android:layout_height="wrap_content" /&gt;
</code></pre>

<p></p>

<p><strong>activity_sign_up.xml</strong></p>

<pre><code>&lt;FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.msh.organizer.SignUpActivity"
tools:ignore="MergeRootFrame" /&gt;
</code></pre>

<p><strong>SignUpActivity.java</strong></p>

<pre><code>package com.msh.organizer;

import android.app.Activity;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.Toast;

public class SignUpActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_sign_up);

    //getActionBar().setDisplayHomeAsUpEnabled(true);

    if (savedInstanceState == null) {
        getFragmentManager().beginTransaction()
                .add(R.id.container, new SignUpFragment())
                .commit();
    }
    //Toast.makeText(this,"Sign Up", Toast.LENGTH_LONG).show();
}


@Override
public boolean onOptionsItemSelected(MenuItem item) {
    // Handle action bar item clicks here. The action bar will
    // automatically handle clicks on the Home/Up button, so long
    // as you specify a parent activity in AndroidManifest.xml.
    int id = item.getItemId();
    if (id == R.id.action_settings) {
        return true;
    }
    return super.onOptionsItemSelected(item);
}
}
</code></pre>

<p><strong>SignUpFragment.java</strong></p>

<pre><code>package com.msh.organizer;

import android.app.Activity;
import android.app.Fragment;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.text.TextUtils;
import android.util.Patterns;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;

import com.parse.ParseException;
import com.parse.ParseUser;
import com.parse.SignUpCallback;


public class SignUpFragment extends Fragment implements View.OnClickListener {
private Button mSignUpButton;
private EditText mNickNameEditText;
private EditText mEmailEditText;
private EditText mPasswordEditText;

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    View rootView = inflater.inflate(R.layout.fragment_sign_up, container, false);

    mSignUpButton = (Button) rootView.findViewById(R.id.sign_up_btn);
    mNickNameEditText = (EditText) rootView.findViewById(R.id.nickname_et);
    mEmailEditText = (EditText) rootView.findViewById(R.id.email_et);
    mPasswordEditText = (EditText) rootView.findViewById(R.id.password_et);

    return rootView;
}

@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);
    mSignUpButton.setOnClickListener(this);
}

@Override
public void onClick(View v) {
    switch (v.getId()) {
        case R.id.sign_up_btn:
            trySignUp();
            break;
    }
}

private void trySignUp() {
    String nickname = mNickNameEditText.getText().toString();
    String email = mEmailEditText.getText().toString();
    String password = mPasswordEditText.getText().toString();
    boolean failed = false;

    if (TextUtils.isEmpty(nickname)){
        mNickNameEditText.setError("Nickname cannnot be empty!");
        failed = true;
    }

    if (TextUtils.isEmpty(password)){
        mPasswordEditText.setError("Password cannnot be empty!");
        failed = true;
    }

    if (TextUtils.isEmpty(email)){
        mEmailEditText.setError("Email cannnot be empty!");
        failed = true;
    }

    if (!Patterns.EMAIL_ADDRESS.matcher(email).matches()){
        mEmailEditText.setError("Inwalid E-mail address!");
        failed = true;
    }
    if (!failed){
        signUp(nickname, email, password);
    }

}

private void signUp(String nickname, String email, String password) {
    ParseUser user = new ParseUser();
    user.setUsername(email);
    user.setPassword(password);
    user.setEmail(email);

// other fields can be set just like with ParseObject
    user.put("nickname", nickname);

    user.signUpInBackground(new SignUpCallback() {
        public void done(ParseException e) {
            if (e == null) {
                if (getActivity() != null){
                    getActivity().setResult(Activity.RESULT_OK);
                    getActivity().finish();
                }
            } else {
                if (getActivity() != null) {
                    Toast.makeText(getActivity(), e.getLocalizedMessage(),     Toast.LENGTH_LONG).show();
                }
            }
        }
    });
}
}
</code></pre>