AndroidDev
AndroidDev

Reputation: 691

onStatusChanged situations

I have some doubts regarding onStatusChanged from LocationListener class.

It know it can present three states: AVAILABLE, TEMPORARILY_UNAVAILABLE and OUT_OF_SERVICE

  1. Does AVAILABLE gets triggered only when coming out of TEMPORARILY_UNAVAILABLE? Or when the GPS has just finished warming-up ? Or right before the first location update?

  2. How about OUT_OF_SERVICE, when does it get triggered? Right before onProviderDisabled ?

  3. Is it possible to simulate these events (statuses) with the emulator?

Upvotes: 8

Views: 848

Answers (1)

j2ko
j2ko

Reputation: 2539

According android source code explanation:

  • OUT_OF_SERVICE is returned if the provider is out of service, and this is not expected to change in the near future
  • TEMPORARILY_UNAVAILABLE is returned if the provider is temporarily unavailable but is expected to be available shortly
  • AVAILABLE is returned if the provider is currently available. If extras is non-null, additional status information may be added to it in the form of provider-specific key/value pairs.

LINK

Upvotes: 1

Related Questions