content: package com.airsaid.mpermissionutils;
  
  import android.Manifest;
  import android.os.Bundle;
  import android.support.annotation.NonNull;
  import android.support.v7.app.AppCompatActivity;
  import android.view.View;
  import android.widget.Toast;
  
  public class MainActivity extends AppCompatActivity {
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
      }
  
      public void callPhone(View v) {
          MPermissionUtils.requestPermissionsResult(this, 1, new String[]{Manifest.permission.CALL_PHONE}
                  , new MPermissionUtils.OnPermissionListener() {
                      @Override
                      public void onPermissionGranted() {
                          Toast.makeText(MainActivity.this, "授权成功,执行拨打电话操作!", Toast.LENGTH_SHORT).show();
                      }
  
                      @Override
                      public void onPermissionDenied() {
                          MPermissionUtils.showTipsDialog(MainActivity.this);
                      }
                  });
      }
  
      @Override
      public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
          MPermissionUtils.onRequestPermissionsResult(requestCode, permissions, grantResults);
          super.onRequestPermissionsResult(requestCode, permissions, grantResults);
      }
  }
  