ShadowLocationManager.getRequestLocationUpdateListeners
Code IndexAdd Codota to your IDE (free)

Best Java code snippets using org.robolectric.shadows.ShadowLocationManager.getRequestLocationUpdateListeners (Showing top 8 results out of 315)

  • Common ways to obtain ShadowLocationManager
private void myMethod () {
ShadowLocationManager s =
  • Object instance;(ShadowLocationManager) Shadow.extract(instance)
  • Smart code suggestions by Codota
}
origin: robolectric/robolectric

providerEntry.criteria = criteria;
providersEnabled.put(provider, providerEntry);
List<LocationListener> locationUpdateListeners = new ArrayList<>(getRequestLocationUpdateListeners());
for (LocationListener locationUpdateListener : locationUpdateListeners) {
 if (isEnabled) {
origin: robolectric/robolectric

@Test
public void shouldStoreRequestLocationUpdateListeners() throws Exception {
 TestLocationListener listener = new TestLocationListener();
 locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 1, 2.0f, listener);
 assertSame(shadowLocationManager.getRequestLocationUpdateListeners().get(0), listener);
}
origin: robolectric/robolectric

@Test
public void shouldRemoveLocationListeners() throws Exception {
 TestLocationListener listener = new TestLocationListener();
 locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 1, 2.0f, listener);
 locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 1, 2.0f, listener);
 TestLocationListener otherListener = new TestLocationListener();
 locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 1, 2.0f, otherListener);
 locationManager.removeUpdates(listener);
 List<LocationListener> expected = new ArrayList<>();
 expected.add(otherListener);
 assertThat(shadowLocationManager.getRequestLocationUpdateListeners()).isEqualTo(expected);
}
origin: robolectric/robolectric

@Test
public void shouldNotThrowExceptionIfLocationListenerRemovedInsideOnLocationChanged() throws Exception {
 TestLocationListenerSelfRemoval listener = new TestLocationListenerSelfRemoval(locationManager);
 shadowLocationManager.requestLocationUpdates(GPS_PROVIDER, 0, 0, listener);
 Location location = new Location(GPS_PROVIDER);
 location.setLatitude(0);
 location.setLongitude(0);
 shadowLocationManager.simulateLocation(location);
 assertThat(shadowLocationManager.getRequestLocationUpdateListeners().size()).isEqualTo(0);
}
origin: org.robolectric/shadows-framework

providerEntry.criteria = criteria;
providersEnabled.put(provider, providerEntry);
List<LocationListener> locationUpdateListeners = new ArrayList<>(getRequestLocationUpdateListeners());
for (LocationListener locationUpdateListener : locationUpdateListeners) {
 if (isEnabled) {
origin: org.robolectric/shadows-core-v23

providerEntry.criteria = criteria;
providersEnabled.put(provider, providerEntry);
List<LocationListener> locationUpdateListeners = new ArrayList<>(getRequestLocationUpdateListeners());
for (LocationListener locationUpdateListener : locationUpdateListeners) {
 if (isEnabled) {
origin: org.robolectric/shadows-core

providerEntry.criteria = criteria;
providersEnabled.put(provider, providerEntry);
List<LocationListener> locationUpdateListeners = new ArrayList<>(getRequestLocationUpdateListeners());
for (LocationListener locationUpdateListener : locationUpdateListeners) {
 if (isEnabled) {
origin: org.robolectric/framework

providerEntry.criteria = criteria;
providersEnabled.put(provider, providerEntry);
List<LocationListener> locationUpdateListeners = new ArrayList<>(getRequestLocationUpdateListeners());
for (LocationListener locationUpdateListener : locationUpdateListeners) {
 if (isEnabled) {
org.robolectric.shadowsShadowLocationManagergetRequestLocationUpdateListeners

Popular methods of ShadowLocationManager

  • setBestProvider
    Sets the value to return from #getBestProvider(android.location.Criteria,boolean) for the given prov
  • setLastKnownLocation
    Sets the value to return from #getLastKnownLocation(String) for the given provider
  • setProviderEnabled
  • addLocationListener
  • cleanupRemovedLocationListeners
  • copyOf
  • distanceBetween
    Returns the distance between the two locations in meters. Adapted from: http://stackoverflow.com/que
  • getAllProviders
  • getBestProvider
  • getBestProviderWithCriteria
  • getBestProviderWithNoCriteria
  • getLastKnownLocation
  • getBestProviderWithNoCriteria,
  • getLastKnownLocation,
  • getProviders,
  • removeDuplicates,
  • getContext,
  • getLastBestProviderCriteria,
  • getLastBestProviderEnabledOnly,
  • getProvidersForListener,
  • getRequestLocationUdpateCriteriaPendingIntents

Popular in Java

  • Finding current android device location
  • addToBackStack (FragmentTransaction)
  • onRequestPermissionsResult (Fragment)
  • runOnUiThread (Activity)
  • FileInputStream (java.io)
    An input stream that reads bytes from a file. File file = ...finally if (in != null) in.clos
  • IOException (java.io)
    Signals a general, I/O-related error. Error details may be specified when calling the constructor, a
  • Semaphore (java.util.concurrent)
    A counting semaphore. Conceptually, a semaphore maintains a set of permits. Each #acquire blocks if
  • JFrame (javax.swing)
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a

For IntelliJ IDEA,
Android Studio or Eclipse

  • Search for JavaScript code betaCodota IntelliJ IDEA pluginCodota Android Studio pluginCode IndexSign in
  • EnterpriseFAQAboutBlogContact Us
  • Plugin user guideTerms of usePrivacy policyCodeboxFind Usages
Add Codota to your IDE (free)