title: Android: why must use getBaseContext() instead of this
body: <p><code>this</code> often to reference to current context. But, at some case, why we must use <code>getBaseContext()</code> instead of <code>this</code>. (It means when use <code>this</code> will notice error). </p>
  
  <p>Here is my example:</p>
  
  <pre><code>Spinner spinner = (Spinner) findViewById(R.id.spinner);
  spinner.setAdapter(adapter);            
  spinner.setOnItemSelectedListener(new OnItemSelectedListener() {
      @Override
      public void onItemSelected(AdapterView&lt;?&gt;arg0, View arg1, int arg2, long arg3){
         Toast.makeText(getBaseContext(),"SELECTED", Toast.LENGTH_SHORT).show(); //this line
      }
  </code></pre>
  
  <p>At above code, when I  change <code>getBaseContext()</code> to <code>this</code> will receive error.</p>
  
  <p>Who can explain for me, please.</p>