title: LocationManager not working on actuall device
body: <p>i have this problem. i am getting the location Updates. it is working fine on my emulator. but when i test it on my device it shows the current location fine. but when i change my position it do not show me updates in my location. but it is working fine on emulator.
  here is my code
  <strong>Main.java</strong></p>
  
  <pre><code>import android.app.Activity;
  import android.app.AlertDialog;
  import android.app.AlertDialog.Builder;
  import android.content.DialogInterface;
  import android.content.DialogInterface.OnClickListener;
  import android.content.Intent;
  import android.location.Location;
  import android.location.LocationListener;
  import android.location.LocationManager;
  import android.os.Bundle;
  import android.util.Log;
  import android.view.Menu;
  import android.widget.TextView;
  import android.widget.Toast;
  
  public class Main extends Activity {
  
      TextView tvStatus;
      LocationManager lm;
      boolean gpsEnabled;
      LocationListener ls = new LocationListener() {
  
          @Override
          public void onStatusChanged(String provider, int status, Bundle extras) {}
  
          @Override
          public void onProviderEnabled(String provider) {}
  
          @Override
          public void onProviderDisabled(String provider) {}
  
          @Override
          public void onLocationChanged(Location location) {
              tvStatus.setText("Latitude: "
                      + location.getLatitude() + "\nLongitude: "
                      + location.getLongitude());
          }
      };
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
          Toast.makeText(this, "on create", 300).show();
          tvStatus = (TextView) findViewById(R.id.textView1);
          lm = (LocationManager) getSystemService(LOCATION_SERVICE);
      }
      @Override
      protected void onResume() {
          super.onResume();
          Toast.makeText(this, "on resume", 200).show();
          if (lm.isProviderEnabled(LocationManager.GPS_PROVIDER)) {
              Location l = lm.getLastKnownLocation(LocationManager.GPS_PROVIDER);
              tvStatus.setText(l.getLatitude()+" "+ l.getLongitude());
              lm.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, ls);
          }else{
              //use network provider
              Toast.makeText(this, "dsfdsfdsfdsf", 300).show();
          }
      }
      @Override
      protected void onPause() {
          super.onPause();
          Toast.makeText(this,"on pause" ,300).show();
          lm.removeUpdates(ls);
      }
  
  }
  </code></pre>
  
  <p>i have added all the permisions in my manifest.xml</p>