title: GPS location after permission not working (SDK 23) android studio
body: <p>I have this class that i have created , where have i need to put my last location?</p>
  
  <pre><code>public class DescriptionActivity extends AppCompatActivity implements GoogleApiClient.ConnectionCallbacks {
  
      TextView t;
      Button up;
      GoogleApiClient mGoogleApiClient;
      LocationManager locationManager;
      LocationListener locationListener;
      LocationServices mLastLocation;
      private static final int PERMS_REQUEST_CODE=123;
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_hr__description);
          Toolbar toolbar = (Toolbar) findViewById(R.id.hr_toolbar);
          setSupportActionBar(toolbar);
          getSupportActionBar().setHomeAsUpIndicator(R.drawable.ic_clear_white_24dp);
          getSupportActionBar().setDisplayHomeAsUpEnabled(true);
          getSupportActionBar().setDisplayShowTitleEnabled(false);
          setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
          t = (TextView) findViewById(R.id.test_boaz);
          up=(Button)findViewById(R.id.upload);
          mGoogleApiClient = new GoogleApiClient.Builder(this)
                  .addApi(Drive.API)
                  .addScope(Drive.SCOPE_FILE)
                  .addConnectionCallbacks(this)
                  .addOnConnectionFailedListener((GoogleApiClient.OnConnectionFailedListener) this)
                  .build();
          if(hasPermission())
          {
              getGPS();
          }
          else {
              requestPerms();
          }
      }
  
      @Override
      public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
          switch (requestCode) {
              case PERMS_REQUEST_CODE:
                  if (grantResults.length &gt; 0 &amp;&amp; grantResults[0] == PackageManager.PERMISSION_GRANTED) {
                      // All good!
                  } else {
                     Log.d("bobbbbbbbbbbbbbbbbbb","boazboabzobaob");
                  }
  
                  break;
          }
      }
  
      private void getGPS() {
          up.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
  
  
              }
          });
      }
  
      private boolean hasPermission(){
              int res=0;
              String[] permissions=new String[]{Manifest.permission.ACCESS_COARSE_LOCATION,Manifest.permission.ACCESS_FINE_LOCATION};
              for(String params:permissions)
              {
                  res=checkCallingOrSelfPermission(params);
                  if(!(res==PackageManager.PERMISSION_GRANTED)) {
                      return false;
                  }
              }
              return true;
          }
  
          private void requestPerms(){
              String[] permissions=new String[]{Manifest.permission.ACCESS_COARSE_LOCATION,Manifest.permission.ACCESS_FINE_LOCATION};
              if(Build.VERSION.SDK_INT &gt;= Build.VERSION_CODES.M)
              {
               requestPermissions(permissions,PERMS_REQUEST_CODE);
                  ActivityCompat.requestPermissions(this, permissions, PERMS_REQUEST_CODE);
              }
  
          }
      @Override
      public boolean onOptionsItemSelected(MenuItem item) {
          switch (item.getItemId()) {
              case android.R.id.home:
                  onBackPressed();
                  return true;
              default:
                  return super.onOptionsItemSelected(item);
          }
      }
  
      @Override
      public void onConnected(@Nullable Bundle bundle) {
          mLastLocation = LocationServices.FusedLocationApi.getLastLocation(mGoogleApiClient);
          if (mLastLocation != null) {
  
          }
      }
  
      @Override
      public void onConnectionSuspended(int i) {
  
      }
  }
  </code></pre>
  
  <p>i tried to activate GPS and it always want me to check permissions
  how to fix it?
  looked on many examples on the internet and i have succeed to get dialog to activate GPS device but when i try to get location i have problem</p>