title: difference and when to use getApplication(), getApplicationContext(), getBaseContext() and someClass.this
body: <p>I'm new to android and I'm trying to understand the difference between <code>getApplication()</code>, <code>getApplicationContext(</code>), <code>getBaseContext()</code>, <code>getContext()</code> and <code>someClass.this</code> and especially when to use the these methods in the following code lines:</p>
  
  <p>When I launch a toast what is the difference between these and in which cases to I use them?</p>
  
  <pre><code>Toast.makeText(LoginActivity.this, "LogIn successful", Toast.LENGTH_SHORT).show();
  Toast.makeText(getApplication(), "LogIn successful", Toast.LENGTH_SHORT).show();
  Toast.makeText(getApplicationContext(), "LogIn successful", Toast.LENGTH_SHORT).show();
  Toast.makeText(getBaseContext(), "LogIn successful", Toast.LENGTH_SHORT).show();
  </code></pre>
  
  <p>same with intents:</p>
  
  <pre><code>Intent intent = new Intent(getApplicationContext(), LoginActivity.class);
  Intent intent = new Intent(MenuPagina., LoginActivity.class);
  Intent intent = new Intent(getBaseContext(), LoginActivity.class);
  Intent intent = new Intent(getApplication(), LoginActivity.class);
  </code></pre>