title: How to add value on Permission Manager
body: <p>I was wondering how to set value on manager? Here's how I initialize PermissionManager manager or PermissionManager manager = new?</p>
  
  <pre><code>public PermissionManager manager = new PermissionManager(PermissionManager.mActivity, PermissionManager.mContext);
  
  
  protected void onStart() {
      super.onStart();
      if (Build.VERSION.SDK_INT &gt;= Build.VERSION_CODES.M) {
          /*String[] list = new String[]{PermissionConsts.PHONE_STATE, PermissionConsts.READ_CONTACTS, PermissionConsts.READ_EXTERNAL_STORAGE,
                  PermissionConsts.READ_SMS};*/
          manager.requestPermission(new String[]{Manifest.permission.ACCESS_FINE_LOCATION});
      }
      Intent serviceIntent = new Intent(this, LocationFetcherService.class);
      startService(serviceIntent);
  }
  </code></pre>
  
  <p>Here it doesn't work:</p>
  
  <pre><code>public boolean onNavigationItemSelected(MenuItem item) {
          // Handle navigation view item clicks here.
          int id = item.getItemId();
  
              if (id == R.id.nav_camera) {
                  initLocationFetching(this);
      }
      }
  </code></pre>
  
  <p>Here is BaseActivityLocation class</p>
  
  <pre><code>public class BaseActivityLocation extends AppCompatActivity implements LocationManagerInterface {
  
      public SmartLocationManager mLocationManager;
      public PermissionManager manager = new PermissionManager(BaseActivityLocation.this, BaseActivityLocation.this);
      public LocationFetcherService mLocationFetcherService;
      private static final int REQUEST_FINE_LOCATION = 1;
      private Activity mCurrentActivity;
      private int count = 0;
  
  
      @Override
      public void locationFetched(Location mLocation, Location oldLocation, String time, String locationProvider) {
          // storing it on application level
          GetAccurateLocationApplication.mCurrentLocation = mLocation;
          GetAccurateLocationApplication.oldLocation = oldLocation;
          GetAccurateLocationApplication.locationProvider = locationProvider;
          GetAccurateLocationApplication.locationTime = time;
      }
  
      public void instatntiate(Activity mActivity){
          /*3rd Parametr*/
          //For One time Gps Usage: SmartLocationManager.USE_ONE_TIME_GPS;
          //For every 10 seconds Gps Usage: SmartLocationManager.USE_UPDATE_TIME_GPS;
  
          /*4th parameter*/
          //For All netwrok Provider: SmartLocationManager.ALL_PROVIDERS;
          //For Network Provider only: SmartLocationManager.NETWORK_PROVIDER;
          //For GPS Provider only: SmartLocationManager.GPS_PROVIDER;
  
          /*Last Parameter*/
          //For using Any Api location: SmartLocationManager.ANY_API; //The priority will be google api.
          //For using google Api location: SmartLocationManager.ONLY_GOOGLE_API;
          //For using android Api Location: SmartLocationManager.ONLY_ANDROID_API;
          mLocationManager = new SmartLocationManager(getApplicationContext(), mActivity, SmartLocationManager.USE_ONE_TIME_GPS, this, SmartLocationManager.ALL_PROVIDERS, LocationRequest.PRIORITY_HIGH_ACCURACY, 10 * 1000, 1 * 1000, SmartLocationManager.LOCATION_PROVIDER_RESTRICTION_NONE, SmartLocationManager.ANY_API); // init location manager
      }
  
      public void initLocationFetching(Activity mActivity) {
          mCurrentActivity = mActivity;
          try {
              if (Build.VERSION.SDK_INT &gt;= Build.VERSION_CODES.M) {
                  manager = new PermissionManager(mCurrentActivity, getApplicationContext());
  
                  PermissionManagerInterface permissionManagerInterface = new PermissionManagerInterface() {
                      @Override
                      public void onPermissionGranted(String message, int requestCode) {
  
                      }
  </code></pre>
  
  <p>Here is the code of Permission Manager class but I am having a null value where I want to eliminate</p>
  
  <pre><code>public class PermissionManager implements RequestPermissionsResultInterface {
  
      public static Activity mActivity;
      public static Context mContext;
      public String[] permissionList;
      public boolean flag;
  
      private PermissionManagerInterface mManagerInterface = new PermissionManagerInterface() {
  
  
      @Override
      public void onPermissionGranted(String message, int requestCode) {
  
      }
  
      @Override
      public void onPermissionDenied(String message, int requestCode) {
  
      }
  
      @Override
      public void isAllGranted(boolean flag) {
  
      }
  };
  
      public PermissionManager(Activity mActivity, Context mContext) {
          this.mActivity = mActivity;
          this.mContext = mContext;
      }
  
      public void requestPermission(String[] mList){
          permissionList = mList;
          ActivityCompat.requestPermissions(mActivity, mList, REQ_CODE);
      }
  
      public void getManagerInterface(PermissionManagerInterface mInterface){
          mManagerInterface = mInterface;
      }
   @RequiresApi(api = Build.VERSION_CODES.M)
  @Override
  public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
  
      if(requestCode == REQ_CODE){
          for (int i = 0, len = permissions.length; i &lt; len; i++) {
              String permission = permissions[i];
              String packageStrippedPermissionName =  permissions[i].substring(permissions[0].lastIndexOf(".")+1);
              if (grantResults[i] == PackageManager.PERMISSION_DENIED) {
                  // user rejected the permission
                  boolean showRationale = mActivity.shouldShowRequestPermissionRationale( permission );
                  if (! showRationale) {
                      AlertDialog.Builder builder = new AlertDialog.Builder(mActivity);
                      builder.setTitle(permission + " Required");
                      builder.setMessage("You have to grant this permission , otherwise app will not be able to continue, Click Yes to go to Settings else app will not resume!");
                      builder.setPositiveButton("Yes", new DialogInterface.OnClickListener() {
                          @Override
                          public void onClick(DialogInterface dialogInterface, int i) {
                              Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
                              Uri uri = Uri.fromParts("package", mActivity.getPackageName(), null);
                              intent.setData(uri);
                              mActivity.startActivityForResult(intent, REQ_CODE);
                          }
                      });
                      builder.setNegativeButton("No", new DialogInterface.OnClickListener() {
                          @Override
                          public void onClick(DialogInterface dialogInterface, int i) {
                              Toast.makeText(mContext, "App will not Start without this Permission", Toast.LENGTH_SHORT).show();
                              mActivity.finish();
                          }
                      });
                      builder.setCancelable(false);
                      builder.show();
                      // user also CHECKED "never ask again"
                      // you can either enable some fall back,
                      // disable features of your app
                      // or open another dialog explaining
                      // again the permission and directing to
                      // the app setting
                  }else{
                      mManagerInterface.onPermissionDenied("\'" + packageStrippedPermissionName + "': permission denied", requestCode);
                      Alert(mActivity, permissions[i]);
                  }
              }else if(grantResults[i] == PackageManager.PERMISSION_GRANTED){
                  mManagerInterface.onPermissionGranted("\'" + packageStrippedPermissionName + "\': permission granted", requestCode);
              }
          }
          ArrayList&lt;String&gt; list = new ArrayList&lt;&gt;();
          for(int k=0; k&lt;grantResults.length; k++){
              if(grantResults[k] == PackageManager.PERMISSION_GRANTED){
                  list.add(permissions[k]);
              }
          }
          if(list.size() == permissions.length){
              flag = true;
              mManagerInterface.isAllGranted(flag);
          }else{
              flag = false;
              mManagerInterface.isAllGranted(flag);
          }
      }
  
  }
  </code></pre>
  
  <p>BaseActivityLocation java class:</p>
  
  <pre><code>BaseActivityLocation extends AppCompatActivity implements LocationManagerInterface {
  
  public SmartLocationManager mLocationManager;
  public PermissionManager manager = null;
  public LocationFetcherService mLocationFetcherService;
  private static final int REQUEST_FINE_LOCATION = 1;
  private Activity mCurrentActivity;
  private int count = 0;
  
  
  @Override
  public void locationFetched(Location mLocation, Location oldLocation, String time, String locationProvider) {
      // storing it on application level
      GetAccurateLocationApplication.mCurrentLocation = mLocation;
      GetAccurateLocationApplication.oldLocation = oldLocation;
      GetAccurateLocationApplication.locationProvider = locationProvider;
      GetAccurateLocationApplication.locationTime = time;
  }
  
  protected void onStart() {
      super.onStart();
      manager = new PermissionManager(BaseActivityLocation.this, BaseActivityLocation.this);
      if (Build.VERSION.SDK_INT &gt;= Build.VERSION_CODES.M) {
      /*String[] list = new String[]{PermissionConsts.PHONE_STATE, PermissionConsts.READ_CONTACTS, PermissionConsts.READ_EXTERNAL_STORAGE,
              PermissionConsts.READ_SMS};*/
          manager.requestPermission(new String[]{Manifest.permission.ACCESS_FINE_LOCATION});
      }
      Intent serviceIntent = new Intent(this, LocationFetcherService.class);
      startService(serviceIntent);
  }
  
  protected void onResume(){
      super.onResume();
      //showLocationPermission();
  }
  </code></pre>
  
  <p>Permission Manager Interface</p>
  
  <pre><code>public interface PermissionManagerInterface extends Serializable
  {
      String TAG = PermissionManagerInterface.class.getSimpleName();
  
      void onPermissionGranted(String message, int requestCode);
  
      void onPermissionDenied(String message, int requestCode);
  
      void isAllGranted(boolean flag);
  }
  </code></pre>