title: Android GPS update location
body: <p>I am making simple application which based on phone's location. I am using <a href="http://www.androidhive.info/2012/07/android-gps-location-manager-tutorial/" rel="nofollow">this code</a> for GPS location. In the <code>main()</code> function I am requesting the GPS location and then I am working with it. (I am calculating the sunrise and sunset)</p>
  
  <p>I can get the location, but when I start the application I get the <code>LastKnown</code> location. So, if I want real "new one" location I must wait for GPS lock on and then restart the application.</p>
  
  <p>So, my question is: How can I get a "fresh" location?</p>
  
  <p>Ok. I have an idea.</p>
  
  <p>Can I call MainActivity refresh from another class?</p>
  
  <p>in GPS class I have this</p>
  
  <pre><code>private final Context mContext;
  
  @Override
  public void onLocationChanged(Location location) {
      startActivity(new Intent(mContext, MainActivity.class));
  }
  </code></pre>
  
  <p>But this doesn't work. Can anyone help?</p>