title: What 'this' refers to in building an intent
body: <p>I just started learning Android and studying the tutorials on the google android website. </p>
  
  <p>In the tutorial I am going through, I am building an intent to start another activity. </p>
  
  <pre><code>com.mycompany.myfirstapp;
  import android.content.Intent;
  import android.os.Bundle;
  import android.support.design.widget.FloatingActionButton;
  import android.support.design.widget.Snackbar;
  import android.support.v7.app.AppCompatActivity;
  import android.support.v7.widget.Toolbar;
  import android.view.View;
  import android.view.Menu;
  import android.view.MenuItem;   
  public class MyActivity extends AppCompatActivity {
      /**Called when the user clicks the Send button**/
      public void sendMessage(View view) {
          //Do something in response to button
          Intent intent = new Intent(this, DisplayMessageActivity.class);
      }
  }
  </code></pre>
  
  <p>The tutorial says "A Context as its first parameter (this is used because the Activity class is a subclass of Context)."</p>
  
  <p>I guess this explanation should be clear enough, but I don't get it.</p>
  
  <p>What I understand is that 'this' inside sendMessage method refers to a current class, so serves as a instance variable of the current class, which is MyActivity. </p>
  
  <p>Is this true?</p>
  
  <p>If that's true, then its type is Activity? which is again a subclass of Context? </p>
  
  <p>I don't understand why the type of 'this' is Activity.
  Please explain this for me. 
  Thank you.</p>