title: getSupportActionBar() The method getSupportActionBar() is undefined for the type TaskActivity. Why?
body: <p>I was recommended to extend my Activity class from ActionBarActivity</p>
  
  <p>Here is the previous code:</p>
  
  <pre><code>import android.support.v7.app.ActionBar;
  import android.support.v7.app.ActionBarActivity;  
  
  public class MainActivity extends Activity  {
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);         
  }
  </code></pre>
  
  <p>I wrote new application and followed advice.</p>
  
  <pre><code>import android.os.Bundle;
      import android.support.v7.app.ActionBar;
      import android.support.v7.app.ActionBarActivity;            
  
      public class MainActivity extends ActionBarActivity {
  
            @Override
            public void onCreate(Bundle savedInstanceState) {
              super.onCreate(savedInstanceState);
              ActionBar actionBar =getSupportActionBar();
              actionBar.setDisplayHomeAsUpEnabled(true);            
              setContentView(R.layout.activity_main);
            }
  
            @Override
            public boolean onCreateOptionsMenu(Menu menu) {
              getMenuInflater().inflate(R.menu.main, menu);
              return true;
            }            
          }
  </code></pre>
  
  <p>If I use ACtionBarActivity instead of Activity, I get the following error on the phone, when I try to run it:</p>
  
  <blockquote>
    <p>The method getSupportActionBar() is undefined for the type TaskActivity</p>
  </blockquote>