title: Android equivalent of getActivity() from/in ActionBarActivity
body: <p>Like my title says, i'm looking for an equivalent of <code>getActivity()</code> in my <code>ActionBarActivity</code> class in my <code>Android project</code>.</p>
  
  <p>I want to pass an <code>Activity</code> parameter in <code>AsyncTask</code> declaration object, because i'm using an <code>Activity</code> object in my custom <code>AsyncTask</code> extended class</p>
  
  <p>Here an example simplest code of my project</p>
  
  <pre><code>public class EventCreator extends ActionBarActivity {
  
  private Context context;
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_even_creator);
      View v = getLayoutInflater().inflate(R.layout.activity_even_creator,null);
      this.context = this.getBaseContext();
  
      final Button createButton = (Button)findViewById(R.id.createEventButton);
      createButton.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View v) {
              AsyncTask&lt;Void,Void,Boolean&gt; eventCreatorSend = new SendEvents(/* here need activity object */);
              eventCreatorSend.execute();
          }
      });
  
  }
  
      class SendEvents extends AsyncTask&lt;Void,Void,Boolean&gt; {
  
          public Activity act;
  
          SendEvents(Activity a) {
              this.act = a;
          }
  
          @Override
          protected void onPreExecute() {
              super.onPreExecute();
              ((LinearLayout)act.findViewById(R.id.layout_loader_create_event)).setVisibility(View.VISIBLE);
          }
  
          @Override
          protected Boolean doInBackground(Void... params) {
  
              SystemClock.sleep(5000);
              return true;
          }
  
          @Override
          protected void onPostExecute(Boolean params) {
              if (params){
  
                  ((LinearLayout)act.findViewById(R.id.layout_loader_create_event)).setVisibility(View.GONE);
                  act.finish();
              }
              else {
                  ((LinearLayout)act.findViewById(R.id.layout_loader_create_event)).setVisibility(View.VISIBLE);
                  Toast.makeText(act,"Fail to send event",Toast.LENGTH_SHORT).show();
              }
          }
  
  
      };
  }
  </code></pre>
  
  <p>In a time, i thought use <code>getParent()</code> from <code>ActionBarActivity</code> class, but it return a null object.
  So how to get the Activity object i want in <code>ActionBarActivity</code> class ?</p>