title: ActionBar in android studio 1.4
body: <p>I updated my Android Studio for version 1.4 and I'm having trouble implementing the ActionBar in activity.
  The application performs the validation of the data from a user via the <code>MainActivity</code> and after that directs the user to the second activity (<code>WelcomeActivity</code>). I'm trying to create an "<code>up navigation</code>" through the code <code>getActionBar().setDisplayHomeAsUpEnabled(true);</code> but when I run the application, it closes at the time will move from one activity to another. If I remove information from the action bar mentioned above, the application works normally.</p>
  
  <p><strong>MainActivity.java</strong></p>
  
  <pre><code>package br.com.luizugliano.actionbar;
  import android.content.Context;
  import android.content.Intent;
  import android.os.Bundle;
  import android.support.v7.app.AppCompatActivity;
  import android.support.v7.widget.Toolbar;
  import android.view.View;
  import android.widget.EditText;
  import android.widget.Toast;
  
  public class MainActivity extends AppCompatActivity {
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
      Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
      setSupportActionBar(toolbar);
  
  }
  
  public void onClickBtBuscar(View view){
      EditText etNome = (EditText) findViewById(R.id.etNome);
      EditText etCPF = (EditText) findViewById(R.id.etCPF);
      String nome = etNome.getText().toString();
      String cpf = etCPF.getText().toString();
      if("luiz".equals(nome) &amp;&amp; "123456789".equals(cpf)){
          Intent intent = new Intent(getContext(),WelcomeActivity.class);
          Bundle params = new Bundle();
          params.putString("nome", "Luiz");
          intent.putExtras(params);
          startActivity(intent);
      }else{
          alert("Usuário não encontrado, faça seu cadastro");
      }
  }
  
  private Context getContext(){
      return this;
  }
  
  private void alert(String s){
      Toast.makeText(this, s, Toast.LENGTH_SHORT).show();
  }
  }
  </code></pre>
  
  <p><strong>WelcomeActivity.java</strong></p>
  
  <pre><code>package br.com.luizugliano.actionbar;
  import android.os.Bundle;
  import android.support.v7.app.AppCompatActivity;
  import android.support.v7.widget.Toolbar;
  import android.view.MenuItem;
  import android.widget.TextView;
  
  public class WelcomeActivity extends AppCompatActivity {
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_welcome);
      Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
      setSupportActionBar(toolbar);
      Bundle args = getIntent().getExtras();
      String nome = args.getString("nome");
  
      //Atualizando o texto do TextView com uma mensagem de boas vindas
      TextView textView = (TextView) findViewById(R.id.textView);
      textView.setText(nome + ", seja bem-vindo.");
  
      //Adiciona o botão de navegação da action bar
      getActionBar().setDisplayHomeAsUpEnabled(true);
  }
  
  @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();
  
      //noinspection SimplifiableIfStatement
      if (id == android.R.id.home) {
          //O método finish encerrará essa activity
          finish();
          return true;
      }
  
      return super.onOptionsItemSelected(item);
  }
  }
  </code></pre>
  
  <p><strong>AndroidManifest.xml</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
  package="br.com.luizugliano.actionbar" &gt;
  
  &lt;application
      android:allowBackup="true"
      android:icon="@mipmap/ic_launcher"
      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.LAUNCHER" /&gt;
          &lt;/intent-filter&gt;
      &lt;/activity&gt;
      &lt;activity
          android:name=".WelcomeActivity"
          android:label="@string/title_activity_welcome"
          android:theme="@style/AppTheme.NoActionBar"
          android:parentActivityName=".MainActivity"&gt;
      &lt;/activity&gt;
  &lt;/application&gt;
  </code></pre>
  
  <p></p>
  
  <p><strong>content_welcome.xml</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:tools="http://schemas.android.com/tools"
  xmlns:app="http://schemas.android.com/apk/res-auto"    android:layout_width="match_parent"
  android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin"
  android:paddingRight="@dimen/activity_horizontal_margin"
  android:paddingTop="@dimen/activity_vertical_margin"
  android:paddingBottom="@dimen/activity_vertical_margin"
  app:layout_behavior="@string/appbar_scrolling_view_behavior"
  tools:showIn="@layout/activity_welcome"
  tools:context="br.com.luizugliano.activity.WelcomeActivity"&gt;
  
  &lt;TextView
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:textAppearance="?android:attr/textAppearanceMedium"
      android:text="Medium Text"
      android:id="@+id/textView" /&gt;
  </code></pre>
  
  <p></p>
  
  <p><strong>activity_welcome.xml</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;android.support.design.widget.CoordinatorLayout
  xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:app="http://schemas.android.com/apk/res-auto"
  xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
  android:layout_height="match_parent" android:fitsSystemWindows="true"
  tools:context="br.com.luizugliano.actionbar.WelcomeActivity"&gt;
  
  &lt;android.support.design.widget.AppBarLayout android:layout_height="wrap_content"
      android:layout_width="match_parent" android:theme="@style/AppTheme.AppBarOverlay"&gt;
  
      &lt;android.support.v7.widget.Toolbar android:id="@+id/toolbar"
          android:layout_width="match_parent" android:layout_height="?attr/actionBarSize"
          android:background="?attr/colorPrimary" app:popupTheme="@style/AppTheme.PopupOverlay" /&gt;
  
  &lt;/android.support.design.widget.AppBarLayout&gt;
  
  &lt;include layout="@layout/content_welcome" /&gt;
  
  &lt;!--&lt;android.support.design.widget.FloatingActionButton android:id="@+id/fab"--&gt;
      &lt;!--android:layout_width="wrap_content" android:layout_height="wrap_content"--&gt;
      &lt;!--android:layout_gravity="bottom|end" android:layout_margin="@dimen/fab_margin"--&gt;
      &lt;!--android:src="@android:drawable/ic_dialog_email" /&gt;--&gt;
  &lt;/android.support.design.widget.CoordinatorLayout&gt;
  </code></pre>
  
  <p><strong>styles.xml</strong></p>
  
  <pre><code>&lt;resources&gt;
  
  &lt;!-- Base application theme. --&gt;
  &lt;style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"&gt;
      &lt;!-- Customize your theme here. --&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;/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;/resources&gt;
  </code></pre>
  
  <p><strong>logcat crash log</strong></p>
  
  <blockquote>
    <p>10-15 00:25:42.457 4456-4456/br.com.luizugliano.actionbar W/System: ClassLoader referenced unknown path: /data/app/br.com.luizugliano.actionbar-2/lib/x86
    10-15 00:25:42.680 4456-4472/br.com.luizugliano.actionbar D/OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true
    10-15 00:25:42.683 4456-4456/br.com.luizugliano.actionbar D/: HostConnection::get() New Host Connection established 0xad70ddb0, tid 4456
    10-15 00:25:42.735 4456-4472/br.com.luizugliano.actionbar D/: HostConnection::get() New Host Connection established 0xad70dfb0, tid 4472
    10-15 00:25:42.757 4456-4472/br.com.luizugliano.actionbar I/OpenGLRenderer: Initialized EGL, version 1.4
    10-15 00:25:42.854 4456-4472/br.com.luizugliano.actionbar W/EGL_emulation: eglSurfaceAttrib not implemented
    10-15 00:25:42.854 4456-4472/br.com.luizugliano.actionbar W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xabfa99e0, error=EGL_SUCCESS
    10-15 00:26:02.266 4456-4456/br.com.luizugliano.actionbar D/AndroidRuntime: Shutting down VM
    10-15 00:26:02.266 4456-4456/br.com.luizugliano.actionbar E/AndroidRuntime: FATAL EXCEPTION: main
    10-15 00:26:02.266 4456-4456/br.com.luizugliano.actionbar E/AndroidRuntime: Process: br.com.luizugliano.actionbar, PID: 4456
    10-15 00:26:02.266 4456-4456/br.com.luizugliano.actionbar E/AndroidRuntime: java.lang.RuntimeException: Unable to start activity ComponentInfo{br.com.luizugliano.actionbar/br.com.luizugliano.actionbar.WelcomeActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.app.ActionBar.setDisplayHomeAsUpEnabled(boolean)' on a null object reference
    10-15 00:26:02.266 4456-4456/br.com.luizugliano.actionbar E/AndroidRuntime:     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2416)
    10-15 00:26:02.266 4456-4456/br.com.luizugliano.actionbar E/AndroidRuntime:     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
    10-15 00:26:02.266 4456-4456/br.com.luizugliano.actionbar E/AndroidRuntime:     at android.app.ActivityThread.-wrap11(ActivityThread.java)
    10-15 00:26:02.266 4456-4456/br.com.luizugliano.actionbar E/AndroidRuntime:     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
    10-15 00:26:02.266 4456-4456/br.com.luizugliano.actionbar E/AndroidRuntime:     at android.os.Handler.dispatchMessage(Handler.java:102)
    10-15 00:26:02.266 4456-4456/br.com.luizugliano.actionbar E/AndroidRuntime:     at android.os.Looper.loop(Looper.java:148)
    10-15 00:26:02.266 4456-4456/br.com.luizugliano.actionbar E/AndroidRuntime:     at android.app.ActivityThread.main(ActivityThread.java:5417)
    10-15 00:26:02.266 4456-4456/br.com.luizugliano.actionbar E/AndroidRuntime:     at java.lang.reflect.Method.invoke(Native Method)
    10-15 00:26:02.266 4456-4456/br.com.luizugliano.actionbar E/AndroidRuntime:     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
    10-15 00:26:02.266 4456-4456/br.com.luizugliano.actionbar E/AndroidRuntime:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
    10-15 00:26:02.266 4456-4456/br.com.luizugliano.actionbar E/AndroidRuntime:  Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.app.ActionBar.setDisplayHomeAsUpEnabled(boolean)' on a null object reference
    10-15 00:26:02.266 4456-4456/br.com.luizugliano.actionbar E/AndroidRuntime:     at br.com.luizugliano.actionbar.WelcomeActivity.onCreate(WelcomeActivity.java:25)
    10-15 00:26:02.266 4456-4456/br.com.luizugliano.actionbar E/AndroidRuntime:     at android.app.Activity.performCreate(Activity.java:6237)
    10-15 00:26:02.266 4456-4456/br.com.luizugliano.actionbar E/AndroidRuntime:     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
    10-15 00:26:02.266 4456-4456/br.com.luizugliano.actionbar E/AndroidRuntime:     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)
    10-15 00:26:02.266 4456-4456/br.com.luizugliano.actionbar E/AndroidRuntime:     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476) 
    10-15 00:26:02.266 4456-4456/br.com.luizugliano.actionbar E/AndroidRuntime:     at android.app.ActivityThread.-wrap11(ActivityThread.java) 
    10-15 00:26:02.266 4456-4456/br.com.luizugliano.actionbar E/AndroidRuntime:     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344) 
    10-15 00:26:02.266 4456-4456/br.com.luizugliano.actionbar E/AndroidRuntime:     at android.os.Handler.dispatchMessage(Handler.java:102) 
    10-15 00:26:02.266 4456-4456/br.com.luizugliano.actionbar E/AndroidRuntime:     at android.os.Looper.loop(Looper.java:148) 
    10-15 00:26:02.266 4456-4456/br.com.luizugliano.actionbar E/AndroidRuntime:     at android.app.ActivityThread.main(ActivityThread.java:5417) 
    10-15 00:26:02.266 4456-4456/br.com.luizugliano.actionbar E/AndroidRuntime:     at java.lang.reflect.Method.invoke(Native Method) 
    10-15 00:26:02.266 4456-4456/br.com.luizugliano.actionbar E/AndroidRuntime:     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) 
    10-15 00:26:02.266 4456-4456/br.com.luizugliano.actionbar E/AndroidRuntime:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) </p>
  </blockquote>