Code example for LocationManager

Methods: addGpsStatusListener

0
    assertThat(shadowLocationManager.getRequestLocationUdpateCriteriaPendingIntents().get(someLocationListenerPendingIntent)).isEqualTo(someCriteria);
  } 
 
  private Listener addGpsListenerToLocationManager() {
    Listener listener = new TestGpsListener();
    locationManager.addGpsStatusListener(listener);
    return listener;
  } 
 
  private static class TestLocationListener implements LocationListener {
    public boolean providerEnabled;
 
    @Override 
    public void onLocationChanged(Location location) {
    } 
 
    @Override 
    public void onStatusChanged(String s, int i, Bundle bundle) {
    } 
 
    @Override