title: How to set up the Back button in the ActionBar?
body: <p>I have this issue in my code, I can't setup the back button in the ActionBar.
  I specified in the AndroidManifest that AProposActivity is a child activity to MainActivity but I have <code>java.lang.NullPointerException.</code>
  There is my code java :</p>
  
  <pre><code> public class AProposActivity extends AppCompatActivity {
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_apropos);
  
      getSupportActionBar().setDefaultDisplayHomeAsUpEnabled(true);
  }
  }
  </code></pre>
  
  <p>and my xml file :</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="com.emi.integre.projet.dentistterms.AProposActivity"&gt;
  
  &lt;TextView
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:textAppearance="?android:attr/textAppearanceMedium"
      android:text="@string/apropos1"
      android:id="@+id/textView3"
      android:layout_above="@+id/textView4"
      android:layout_alignParentLeft="true"
      android:layout_alignParentStart="true"
      android:layout_marginBottom="42dp" /&gt;
  
  &lt;TextView
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:textAppearance="?android:attr/textAppearanceMedium"
      android:text="@string/apropos2"
      android:id="@+id/textView4"
      android:layout_centerVertical="true"
      android:layout_alignParentLeft="true"
      android:layout_alignParentStart="true" /&gt;
  
  &lt;TextView
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:textAppearance="?android:attr/textAppearanceMedium"
      android:text="@string/name1"
      android:id="@+id/textView5"
      android:layout_below="@+id/textView4"
      android:layout_alignParentLeft="true"
      android:layout_alignParentStart="true"
      android:layout_marginRight="24dp"
      android:layout_marginLeft="24dp"/&gt;
  
  &lt;TextView
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:textAppearance="?android:attr/textAppearanceMedium"
      android:text="@string/name2"
      android:id="@+id/textView6"
      android:layout_below="@+id/textView5"
      android:layout_alignParentLeft="true"
      android:layout_alignParentStart="true"
      android:layout_marginRight="24dp"
      android:layout_marginLeft="24dp"/&gt;
  
  &lt;TextView
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:textAppearance="?android:attr/textAppearanceMedium"
      android:text="@string/name3"
      android:id="@+id/textView7"
      android:layout_below="@+id/textView6"
      android:layout_alignParentLeft="true"
      android:layout_alignParentStart="true"
      android:layout_marginRight="24dp"
      android:layout_marginLeft="24dp"/&gt;
  
  &lt;TextView
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:textAppearance="?android:attr/textAppearanceMedium"
      android:text="@string/name4"
      android:id="@+id/textView8"
      android:layout_below="@+id/textView7"
      android:layout_alignParentLeft="true"
      android:layout_alignParentStart="true"
      android:layout_marginRight="24dp"
      android:layout_marginLeft="24dp"/&gt;
  
  &lt;TextView
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:textAppearance="?android:attr/textAppearanceMedium"
      android:text="@string/apropos4"
      android:id="@+id/textView9"
      android:layout_marginBottom="56dp"
      android:layout_alignParentBottom="true"
      android:layout_centerHorizontal="true"
      android:layout_marginRight="12dp"
      android:layout_marginLeft="12dp"/&gt;
  
  &lt;TextView
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:textAppearance="?android:attr/textAppearanceMedium"
      android:text="@string/apropos3"
      android:id="@+id/textView11"
      android:layout_above="@+id/textView10"
      android:layout_alignParentLeft="true"
      android:layout_alignParentStart="true" /&gt;
  
  &lt;TextView
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:textAppearance="?android:attr/textAppearanceMedium"
      android:text="@string/name5"
      android:id="@+id/textView10"
      android:layout_above="@+id/textView9"
      android:layout_alignLeft="@+id/textView8"
      android:layout_alignStart="@+id/textView8" /&gt;
  </code></pre>
  
  <p>
  there is also my AndroidManifest :</p>
  
  <pre><code>&lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
  package="com.emi.integre.projet.dentistterms"&gt;
  
  &lt;application
      android:allowBackup="true"
      android:icon="@drawable/logo"
      android:label="@string/app_name"
      android:supportsRtl="true"
      android:theme="@style/AppTheme"&gt;
      &lt;activity
          android:name=".MainActivity"
          android:label="@string/app_name"
          android:theme="@style/AppTheme.NoActionBar"&gt;
          &lt;intent-filter&gt;
              &lt;action android:name="android.intent.action.MAIN" /&gt;
  
              &lt;category android:name="android.intent.category.DEFAULT" /&gt;
          &lt;/intent-filter&gt;
      &lt;/activity&gt;
      &lt;activity android:name=".AcceuilActivity"&gt;
          &lt;intent-filter&gt;
              &lt;action android:name="android.intent.action.MAIN" /&gt;
  
              &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
          &lt;/intent-filter&gt;
      &lt;/activity&gt;
      &lt;activity
          android:name=".ResultActivity"
          android:label="Voici le terme dans les 3 langues"
          android:parentActivityName=".MainActivity"&gt;
          &lt;meta-data
              android:name="android.support.PARENT_ACTIVITY"
              android:value="com.emi.integre.projet.dentistterms.MainActivity" /&gt;
      &lt;/activity&gt;
      &lt;activity
          android:name=".SearchActivity"
          android:label="Rechercher un terme"
          android:parentActivityName=".MainActivity"&gt;
          &lt;meta-data
              android:name="android.support.PARENT_ACTIVITY"
              android:value="com.emi.integre.projet.dentistterms.MainActivity" /&gt;
      &lt;/activity&gt;
  
      &lt;activity android:name=".AProposActivity" android:label="A Propos"
          android:parentActivityName=".MainActivity" &gt;
          &lt;meta-data
              android:name="android.support.PARENT_ACTIVITY"
              android:value="com.emi.integre.projet.dentistterms.MainActivity"/&gt;
      &lt;/activity&gt;
  
  &lt;/application&gt;
  </code></pre>
  
  <p></p>
  
  <p>here is also my styles.xml file : </p>
  
  <pre><code>&lt;resources xmlns:tools="http://schemas.android.com/tools"&gt;
  
  
  &lt;style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"&gt;
  
      &lt;item name="colorPrimary"&gt;@color/colorPrimary&lt;/item&gt;
      &lt;item name="colorPrimaryDark"&gt;@color/colorPrimaryDark&lt;/item&gt;
      &lt;item name="colorAccent"&gt;@color/colorAccent&lt;/item&gt;
      &lt;item name="android:colorBackground"&gt;@color/background_material_light&lt;/item&gt;
      &lt;item name="android:textColorPrimary"&gt;@android:color/black&lt;/item&gt;
      &lt;item name="drawerArrowStyle"&gt;@style/DrawerArrowStyle&lt;/item&gt;
      &lt;item name="android:windowTranslucentStatus" tools:targetApi="21"&gt;true&lt;/item&gt;
      &lt;item name="android:windowContentOverlay"&gt;@null&lt;/item&gt;
      &lt;item name="windowActionBar"&gt;false&lt;/item&gt;
      &lt;item name="windowNoTitle"&gt;true&lt;/item&gt;
      &lt;item name="android:navigationBarColor" tools:targetApi="21"&gt;@color/navigationBarColor
      &lt;/item&gt;
      &lt;item name="android:windowDrawsSystemBarBackgrounds" tools:targetApi="21"&gt;true&lt;/item&gt;
  &lt;/style&gt;
  
  &lt;style name="AppTheme.NoActionBar"&gt;
      &lt;item name="windowActionBar"&gt;false&lt;/item&gt;
      &lt;item name="windowNoTitle"&gt;true&lt;/item&gt;
  &lt;/style&gt;
  
  &lt;style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" /&gt;
  
  &lt;style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" /&gt;
  
  &lt;style name="DrawerArrowStyle" parent="Widget.AppCompat.DrawerArrowToggle"&gt;
      &lt;item name="spinBars"&gt;true&lt;/item&gt;
      &lt;item name="color"&gt;@color/drawerArrowColor&lt;/item&gt;
  &lt;/style&gt;
  </code></pre>
  
  <p></p>