title: Find Current Location Android 6.0
body: <p>i have a problem to find current position with android 6.0 (sdk 23).</p>
  
  <p>In main activity i wrote:</p>
  
  <pre><code>       locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
  
          locationListener = new LocationListener() {
  
              @Override
              public void onLocationChanged(Location location) {
  
  textView.append("\n " + location.getLongitude() + " " + location.getLatitude());
  
              }
  
              @Override
              public void onStatusChanged(String provider, int status, Bundle extras) {
  
              }
  
              @Override
              public void onProviderEnabled(String provider) {
  
              }
  
              @Override
              public void onProviderDisabled(String provider) {
                  Intent i = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);
                  startActivity(i);
              }
  
          };
  
          configure_list();
  </code></pre>
  
  <p>implementing also on request permission result:</p>
  
  <pre><code>    @Override
      public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
          switch (requestCode) {
              case 10:
                  if (grantResults.length &gt; 0 &amp;&amp; grantResults[0] == PackageManager.PERMISSION_GRANTED) {
                      // permission granted
  
                  } else {
                      // permission denied
  
                  }
                  break;
              default:
                  break;
          }
      }
  
      public void configure_list() {
          // first check for permissions
          if 
  
  (ActivityCompat.checkSelfPermission(Applicazione.getInstance().getApplicationContext(), Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED &amp;&amp; ActivityCompat.checkSelfPermission(Applicazione.getInstance().getApplicationContext(), Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
          if (Build.VERSION.SDK_INT &gt;= Build.VERSION_CODES.M) {
              requestPermissions(new String[]{Manifest.permission.ACCESS_COARSE_LOCATION,Manifest.permission.ACCESS_FINE_LOCATION,Manifest.permission.INTERNET} ,10);
          }
          return;
      }
  
      locationManager.requestLocationUpdates("gps", 5000, 0, locationListener);
  
  }
  </code></pre>
  
  <p>But current location is always 0. Is there an error? Can anyone suggest me something?</p>