title: How to perform an action when clicking a button inside a fragment
body: <p>Inside my fragment I have a button and when I press the button, I want to perform a call.</p>
  
  <p>However,when I click the button, nothing seems to happen, what am I doing wrong here ?</p>
  
  <p>This is my fragment code :</p>
  
  <pre><code>package fr.aitec_informatique.aitecinformatiques;
  
  
  import android.Manifest;
  import android.content.Intent;
  import android.content.pm.PackageManager;
  import android.net.Uri;
  import android.os.Bundle;
  import android.support.v4.app.ActivityCompat;
  import android.support.v4.app.Fragment;
  import android.view.LayoutInflater;
  import android.view.View;
  import android.view.ViewGroup;
  import android.widget.Button;
  import android.content.Context;
  import android.widget.ListView;
  
  /**
   * A simple {@link Fragment} subclass.
   */
  public class HomeFragment extends Fragment {
  
      Button dial;
  
      private Context mContext;
  
      public HomeFragment() {
          // Required empty public constructor
      }
  
      @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container,
                               Bundle savedInstanceState){
          View v = inflater.inflate(R.layout.fragment_home, container, false);
  
          v.findViewById(R.id.dial);
  
          return v;
      }
      public void onDialButton(View v) {
          Intent intent = new Intent(Intent.ACTION_CALL);
          intent.setData(Uri.parse("tel:xxxxxxxxxx"));
  
          if (ActivityCompat.checkSelfPermission(getActivity(), Manifest.permission.CALL_PHONE) != PackageManager.PERMISSION_GRANTED) {
              return;
          }
          startActivity(intent);
      }
  }
  </code></pre>