title: Not able to make Call using the Call Function in TabLayout
body: <p>I have created a tab layout. I want to make a number callable for which I have to define <code>onCLickListener</code>, please see the code written in <code>Tab2</code> below:
  In this error showing is that <code>MainActivity.this</code> is not an enclosed class, so what should I write instead of this? (<code>tab2.xml</code> is the name of Layout file of Tab)</p>
  
  <pre><code>package com.firstapp.admin.herbalteaco;
  
  import android.Manifest;
  import android.app.Activity;
  import android.content.Intent;
  import android.content.pm.PackageManager;
  import android.net.Uri;
  
  import android.support.v4.app.ActivityCompat;
  import android.support.v4.app.Fragment;
  import android.os.Bundle;
  import android.support.annotation.Nullable;
  import android.view.LayoutInflater;
  import android.view.View;
  import android.view.ViewGroup;
  import android.widget.Button;
  import android.widget.TextView;
  
  /**
   * Created by admin on 11/25/2017.
   */
  
  public class Tab2 extends Fragment implements View.OnClickListener{
  
  
  private TextView tvCall;
  private Button btnLogin;
  
  
  @Nullable
  @Override
  public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) {
      return inflater.inflate(R.layout.tab2 , container , false);
  
  }
  
  @Override
  public void onCreate(@Nullable Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      btnLogin = (Button) btnLogin.findViewById(R.id.btnLogin);
      btnLogin.setOnClickListener(this);
  
      tvCall = (TextView) tvCall.findViewById(R.id.tvCall);
      tvCall.setOnClickListener((new View.OnClickListener() {
          public void onClick(View arg0) {
              Intent callIntent = new Intent(Intent.ACTION_CALL);
              callIntent.setData(Uri.parse("tel:+91999999999"));;
              if (ActivityCompat.checkSelfPermission( MainActivity.this,
                      Manifest.permission.CALL_PHONE) != PackageManager.PERMISSION_GRANTED) {
                  return;
              }
              startActivity(callIntent);
          }
      }));
  
  }
  </code></pre>