title: How to pass data in static class/method from non static?
body: <p>I got static class that is loading data from server and packs it into objects that later goes into array and are passed to normal class. I want to add parameter "distance to user" and it requires user location to calculate. All of items are in different java classes.
  Method from static class that sorts things from server response to object. </p>
  
  <pre><code>public static List&lt;Quake&gt; extractEarthquakes(String earthquakeJSON) {
      if (TextUtils.isEmpty(earthquakeJSON)) {
          return null;
      }
      List&lt;Quake&gt; earthquakes = new ArrayList&lt;&gt;();
  JSONObject jsonObj = new JSONObject(earthquakeJSON);
          JSONArray features = jsonObj.getJSONArray("features");
          for (int i = 0; i &lt; features.length(); i++) {
              double distance = 0;
              JSONObject currentEarthquake = features.getJSONObject(i);
              JSONObject properties = currentEarthquake.getJSONObject("properties");
              double mag = properties.getDouble("mag");
              String location = properties.getString("place");
              String date = properties.getString("time");
              String url = properties.getString("url");
              int felt = 0;
              if(!properties.isNull("felt")) {
                  felt = properties.getInt("felt");
              }
              JSONObject geometry = currentEarthquake.getJSONObject("geometry");
              JSONArray coordinates = geometry.getJSONArray("coordinates");
              double longitude = coordinates.getDouble(0);
              double latitude = coordinates.getDouble(1);
              int depth = coordinates.getInt(2);
              Quake earthquake = new Quake(mag, location, date, url, felt, longitude, latitude, depth, distance);
              earthquakes.add(earthquake);
          }
      }
      return earthquakes;
  }r
  </code></pre>
  
  <p>Object is created as simple data holder (one item just for example)</p>
  
  <pre><code>public class Quake {
    private double kmag;
    //and others
  
    public Quake(double mag, String location, String date, String url, int felt, double longitude, double latitude, int depth, double distance){
      kmag = mag; 
    //and others
  
    public double getMag() {
      return kmag;
    }
  </code></pre>
  
  <p>In MainActivity there is LoaderManager which starts loader class to work. Also there is LocationManager which gets user longitude/latitude. So far i got few ideas how to do that, but none of them worked.</p>
  
  <ol>
  <li>to set value for each object element in array list</li>
  <li>find location inside static class </li>
  <li>somehow pass two double variables into static from non static</li>
  </ol>
  
  <p>As far as I know last one is impossible. While in my object I couldn't change any value, there is no <code>.setValue()</code> method in it, so most that I could've done is to set new value for kmag (those variables that used for return).</p>
  
  <p>Finally, I couldn't transfer my LocationManager into static class because it needs to ask users permission and in example that I've found all methods were not static. So my question is: is there anything that I'm missing? Maybe there is other, simpler way to do that or I just failed in one of those 3?</p>