title: java.lang.NullPointerException (after tried third attempt still giving the same error)
body: <p>I'm new with android development. I'm currently developing an Android Application on Face Recognition. I'm trying to run an existing source code that I obtain from github. The codes seems does not have any error(red line beneath the code). When I tried to run, the application has stopped working and gave me a java.lang.NullPointerException error.</p>
  
  <pre><code>Caused by: java.lang.NullPointerException
             at java.util.Objects.requireNonNull(Objects.java:98)
             at com.example.syafiq.testing.FdActivity.onCreate(FdActivity.java:179)
  </code></pre>
  
  <p>on the highlighted error (FdActivity.java:179)</p>
  
  <pre><code>(line 178) ActionBar actionBar = getActionBar();
  (line 179) actionBar.setDisplayHomeAsUpEnabled(true);
  </code></pre>
  
  <p>I've tried solution that I've found on the Internet</p>
  
  <p>First try:</p>
  
  <pre><code>ActionBar actionBar = getActionBar();
  assert actionBar != null;
  actionBar.setDisplayHomeAsUpEnabled(true);
  </code></pre>
  
  <p>And yet still the same error, so i tried another one that I found on the Internet.</p>
  
  <p>Second try:</p>
  
  <pre><code>ActionBar actionBar = getActionBar();
      if (actionBar != null) {
          actionBar.setDisplayHomeAsUpEnabled(true);
      }
  </code></pre>
  
  <p>The result still the same<br>
  I've tried the third one</p>
  
  <p>Third try:</p>
  
  <pre><code>ActionBar actionBar = getActionBar();
  Objects.requireNonNull(actionBar).setDisplayHomeAsUpEnabled(true);
  </code></pre>
  
  <p>All the three solution that I've tried still giving the same error, point to line 179 </p>
  
  <p>For android manifest.xml(obtain from source code on github):</p>
  
  <pre><code>android:theme="@android:style/Theme.Holo"
  </code></pre>
  
  <p>But the source code does not have style.xml file under the values folder. But my android studio include with style.xml file and the code is:</p>
  
  <pre><code>&lt;style name="Theme.Holo" parent="Theme.AppCompat.Light.DarkActionBar"&gt;
  </code></pre>
  
  <p>I did not use the import tools instead I've created manually (.java, .xml and other libraries that included)</p>