title: Toast inside onClick method in Fragment
body: <p>I have a following Fragment:</p>
  
  <pre><code>public class FragmentSocial extends Fragment implements ActionBar.TabListener, OnClickListener 
  {
  
  private Fragment mFragment;
  
  @Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      getActivity().setContentView(R.layout.fragment_social);
  }
  
  public void onTabSelected(Tab tab, FragmentTransaction ft) {
      // relevant code...
  }
  
  public void onTabUnselected(Tab tab, FragmentTransaction ft) {
      // relevant code...
  }
  
  public void onTabReselected(Tab tab, FragmentTransaction ft) {
      // TODO Auto-generated method stub
  
  }
  
  public void onClick(View v) {
      switch(v.getId())
      {
      case R.id.imgBtnFB:
          Toast.makeText(this, "FB pressed", Toast.LENGTH_LONG).show();
          break;
      case R.id.imgBtnTwitter:
          Toast.makeText(this, "Twitter pressed", Toast.LENGTH_LONG).show();
          break;
      }
  
  }
  </code></pre>
  
  <p>I have a few image buttons in my <code>fragment_social</code> layout. For now I just want to make a Toast message to see what button was pressed. However, if I use <code>this</code> as context, I'm getting this error message:
  <em>The method makeText(Context, CharSequence, int) in the type Toast is not applicable for the arguments (FragmentSocial, String, int)</em>
  I tried to change <code>this</code> to <code>FragmentSocial.this</code>, to <code>FragmentSocial.this.getActivity()</code>, tried to create <code>private Context mContext</code> and to instantiate it to <code>mContext = (I tried various options here)</code> inside the onCreate method - but nothing worked. I either didn't have an error message, but also didn't see the Toast, or got other errors.</p>
  
  <p>So how can I create a Toast here?</p>
  
  <p>Thank you!</p>