title: Is it safe to use MainActivity.this
body: <p>Is it safe to use <code>MainActivity.this</code> in anonymous class when starting a new <code>Activity</code>, please check the code below. I used to create an init a variable of <code>Activity</code> type, but this approach looks better for me.</p>
  
  <p>The question is, is it <strong>safe</strong> to use it?</p>
  
  <pre><code>button.setOnClickListener(new View.OnClickListener() {
      @Override
      public void onClick(View view) {
          startActivity(new Intent(MainActivity.this, SomeOtherActivity.class));
      }
  });
  </code></pre>