title: Create instance of ActionBar Xamarin Android
body: <p>Iam using A ActionBar in my app. I have done something like so:-</p>
  
  <pre><code>ActionBar.SetDisplayHomeAsUpEnabled(true);
  ActionBar.SetHomeButtonEnabled(true);
  </code></pre>
  
  <p>But I get a compilation error like:-</p>
  
  <pre><code>A object reference is required for the non-static field, method, or property 'Android.Support.V7.App.ActionBar.SetDisplayHomeAsUpEnabled(bool)'
  </code></pre>
  
  <p>How can I create a instance of ActionBar as it is a Abstract class?</p>
  
  <p><strong>EDIT:-</strong></p>
  
  <p>With waquaslam's solution I did this:-</p>
  
  <pre><code>public class Homescreen : ActionBarActivity
  {
  
      private DrawerLayout _drawer;
      private MyActionBarDrawerToggle _drawerToggle;
      private ListView _drawerList;
      private static ActionBar ActionBar ;
  
      private string _drawerTitle;
      private string _title;
      private string[] _planetTitles;
  
      protected override void OnCreate(Bundle savedInstanceState)
      {
          base.OnCreate(savedInstanceState);
  
          SupportRequestWindowFeature(WindowCompat.FeatureActionBar);
  
  
  
          SetContentView(Resource.Layout.homescreen);
  
  
  
  
          _title = _drawerTitle = Title;
          _planetTitles = Resources.GetStringArray(Resource.Array.TitlesArray);
          _drawer = FindViewById&lt;DrawerLayout&gt;(Resource.Id.drawer_layout);
          _drawerList = FindViewById&lt;ListView&gt;(Resource.Id.left_drawer);
  
          _drawer.SetDrawerShadow(Resource.Drawable.drawer_shadow_dark, (int)GravityFlags.Left);
  
          _drawerList.Adapter = new ArrayAdapter&lt;string&gt;(this,
              Resource.Layout.drawerlistitem, _planetTitles);
          _drawerList.ItemClick += (sender, args) =&gt; SelectItem(args.Position);
  
  
  
  
  
  
          SupportActionBar.SetDisplayHomeAsUpEnabled(true);
  
          SupportActionBar.SetHomeButtonEnabled(true);
  
          //DrawerToggle is the animation that happens with the indicator next to the
          //ActionBar icon. 
          _drawerToggle = new MyActionBarDrawerToggle(this, _drawer,
                                                    Resource.Drawable.ic_drawer_light,
                                                    Resource.String.DrawerOpen,
                                                    Resource.String.DrawerClose);
  
          //You can alternatively use _drawer.DrawerClosed here
          _drawerToggle.DrawerClosed += delegate
          {
              ActionBar.Title = _title;
              //InvalidateOptionsMenu();
          };
  
          //You can alternatively use _drawer.DrawerOpened here
          _drawerToggle.DrawerOpened += delegate
          {
              ActionBar.Title = _drawerTitle;
              // InvalidateOptionsMenu();
          };
  
          _drawer.SetDrawerListener(_drawerToggle);
  
          if (null == savedInstanceState)
              SelectItem(0);
  
      }
  </code></pre>
  
  <p>Now I get  a <code>NoClassDefinitionFoundError</code>.</p>