本文整理匯總了Java中android.location.LocationProvider.TEMPORARILY_UNAVAILABLE屬性的典型用法代碼示例。如果您正苦於以下問題:Java LocationProvider.TEMPORARILY_UNAVAILABLE屬性的具體用法?Java LocationProvider.TEMPORARILY_UNAVAILABLE怎麽用?Java LocationProvider.TEMPORARILY_UNAVAILABLE使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類android.location.LocationProvider
的用法示例。
在下文中一共展示了LocationProvider.TEMPORARILY_UNAVAILABLE屬性的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: onStatusChanged
/**
* provider的在可用、暫時不可用和無服務三個狀態直接切換時觸發此函數
*
* @param provider 提供者
* @param status 狀態
* @param extras provider可選包
*/
@Override
public void onStatusChanged(String provider, int status, Bundle extras) {
if (mListener != null) {
mListener.onStatusChanged(provider, status, extras);
}
switch (status) {
case LocationProvider.AVAILABLE:
Log.d(TAG, "當前GPS狀態為可見狀態");
break;
case LocationProvider.OUT_OF_SERVICE:
Log.d(TAG, "當前GPS狀態為服務區外狀態");
break;
case LocationProvider.TEMPORARILY_UNAVAILABLE:
Log.d(TAG, "當前GPS狀態為暫停服務狀態");
break;
}
}
示例2: onStatusChanged
/**
* provider的在可用、暫時不可用和無服務三個狀態直接切換時觸發此函數
*
* @param provider 提供者
* @param status 狀態
* @param extras provider可選包
*/
@Override
public void onStatusChanged(String provider, int status, Bundle extras) {
if (mListener != null) {
mListener.onStatusChanged(provider, status, extras);
}
switch (status) {
case LocationProvider.AVAILABLE:
LogUtils.d("onStatusChanged", "當前GPS狀態為可見狀態");
break;
case LocationProvider.OUT_OF_SERVICE:
LogUtils.d("onStatusChanged", "當前GPS狀態為服務區外狀態");
break;
case LocationProvider.TEMPORARILY_UNAVAILABLE:
LogUtils.d("onStatusChanged", "當前GPS狀態為暫停服務狀態");
break;
}
}
示例3: onStatusChanged
/**
* provider的在可用、暫時不可用和無服務三個狀態直接切換時觸發此函數
*
* @param provider 提供者
* @param status 狀態
* @param extras provider可選包
*/
@Override
public void onStatusChanged(String provider, int status, Bundle extras) {
if (mListener != null) {
mListener.onStatusChanged(provider, status, extras);
}
switch (status) {
case LocationProvider.AVAILABLE:
Logger.d("onStatusChanged", "當前GPS狀態為可見狀態");
break;
case LocationProvider.OUT_OF_SERVICE:
Logger.d("onStatusChanged", "當前GPS狀態為服務區外狀態");
break;
case LocationProvider.TEMPORARILY_UNAVAILABLE:
Logger.d("onStatusChanged", "當前GPS狀態為暫停服務狀態");
break;
}
}
示例4: onStatusChanged
@Override
public void onStatusChanged(String provider, int status, Bundle extras) {
LogHelper.debugLog("\"" + this.getClass().getName() + "\" onStatusChanged");
switch (status) {
case LocationProvider.OUT_OF_SERVICE:
LogHelper.infoLog("\"" + provider + "\" provider status changed: Out of service");
break;
case LocationProvider.TEMPORARILY_UNAVAILABLE:
LogHelper.infoLog("\"" + provider + "\" provider status changed: Temporarily unavailable");
break;
case LocationProvider.AVAILABLE:
LogHelper.infoLog("\"" + provider + "\" provider status changed: Available");
break;
}
}
示例5: onStatusChanged
/**
* provider的在可用、暫時不可用和無服務三個狀態直接切換時觸發此函數
*
* @param provider 提供者
* @param status 狀態
* @param extras provider可選包
*/
@Override
public void onStatusChanged(String provider, int status, Bundle extras) {
if (mListener != null) {
mListener.onStatusChanged(provider, status, extras);
}
switch (status) {
case LocationProvider.AVAILABLE:
Log.d("LocationUtils", "當前GPS狀態為可見狀態");
break;
case LocationProvider.OUT_OF_SERVICE:
Log.d("LocationUtils", "當前GPS狀態為服務區外狀態");
break;
case LocationProvider.TEMPORARILY_UNAVAILABLE:
Log.d("LocationUtils", "當前GPS狀態為暫停服務狀態");
break;
}
}
示例6: onStatusChanged
public void onStatusChanged(String provider, int status, Bundle extras) {
switch (status) {
// GPS狀態為可見時
case LocationProvider.AVAILABLE:
Log.i(TAG, "simpleGPS 當前GPS狀態為可見狀態");
break;
// GPS狀態為服務區外時
case LocationProvider.OUT_OF_SERVICE:
Log.i(TAG, "當前GPS狀態為服務區外狀態");
break;
// GPS狀態為暫停服務時
case LocationProvider.TEMPORARILY_UNAVAILABLE:
Log.i(TAG, "當前GPS狀態為暫停服務狀態");
break;
}
}
示例7: onStatusChanged
/**
* provider的在可用、暫時不可用和無服務三個狀態直接切換時觸發此函數
*
* @param provider 提供者
* @param status 狀態
* @param extras provider可選包
*/
@Override
public void onStatusChanged(String provider, int status, Bundle extras) {
if (mListener != null) {
mListener.onStatusChanged(provider, status, extras);
}
switch (status) {
case LocationProvider.AVAILABLE:
Log.d("onStatusChanged", "當前GPS狀態為可見狀態");
break;
case LocationProvider.OUT_OF_SERVICE:
Log.d("onStatusChanged", "當前GPS狀態為服務區外狀態");
break;
case LocationProvider.TEMPORARILY_UNAVAILABLE:
Log.d("onStatusChanged", "當前GPS狀態為暫停服務狀態");
break;
}
}
示例8: onStatusChanged
@Override
public void onStatusChanged(String provider, int status, Bundle extras) {
String statusString;
switch (status) {
case LocationProvider.AVAILABLE:
statusString = "AVAILABLE";
break;
case LocationProvider.OUT_OF_SERVICE:
statusString = "OUT_OF_SERVICE";
break;
case LocationProvider.TEMPORARILY_UNAVAILABLE:
statusString = "TEMPORARILY_UNAVAILABLE";
break;
default:
statusString = "UNKNOWN";
break;
}
Log.d(INNER_TAG, String.format("onStatusChanged(): %s", statusString));
}
示例9: onStatusChanged
@Override
public void onStatusChanged(String provider, int status, Bundle extras) {
Log.i(TAG, "onStatusChanged() Status=" + status);
if (listener != null)
switch (status) {
case LocationProvider.AVAILABLE:
listener.onProviderAvailable();
break;
case LocationProvider.OUT_OF_SERVICE:
locationManager.removeUpdates(locationListener);
listener.onProviderUnavailable();
break;
case LocationProvider.TEMPORARILY_UNAVAILABLE:
locationManager.removeUpdates(locationListener);
listener.onProviderUnavailable();
break;
}
}
示例10: onStatusChanged
@Override
public void onStatusChanged(String provider, int status, Bundle extras) {
String statusStr = null;
switch (status) {
case LocationProvider.OUT_OF_SERVICE:
statusStr = "OUT_OF_SERVICE";
break;
case LocationProvider.TEMPORARILY_UNAVAILABLE:
statusStr = "TEMPORARILY_UNAVAILABLE";
break;
case LocationProvider.AVAILABLE:
statusStr = "AVAILABLE";
break;
}
Log.v(TAG, "onStatusChange(" + provider + ", " + statusStr + ")");
}
示例11: onStatusChanged
@Override
public void onStatusChanged(final String pProvider, final int pStatus, final Bundle pExtras) {
switch (pStatus) {
case LocationProvider.AVAILABLE:
this.mLocationListener.onLocationProviderStatusChanged(LocationProviderStatus.AVAILABLE, pExtras);
break;
case LocationProvider.OUT_OF_SERVICE:
this.mLocationListener.onLocationProviderStatusChanged(LocationProviderStatus.OUT_OF_SERVICE, pExtras);
break;
case LocationProvider.TEMPORARILY_UNAVAILABLE:
this.mLocationListener.onLocationProviderStatusChanged(LocationProviderStatus.TEMPORARILY_UNAVAILABLE, pExtras);
break;
default:
throw new IllegalArgumentException("Unexpected " + LocationProvider.class.getSimpleName() + ": '" + pStatus + "'.");
}
}
示例12: onStatusChanged
@Override
public void onStatusChanged(String provider, int status, Bundle extras) {
String newStatus = "";
switch (status) {
case LocationProvider.OUT_OF_SERVICE:
newStatus = "OUT_OF_SERVICE";
break;
case LocationProvider.TEMPORARILY_UNAVAILABLE:
newStatus = "TEMPORARILY_UNAVAILABLE";
break;
case LocationProvider.AVAILABLE:
newStatus = "AVAILABLE";
break;
}
debug(provider + " offline: " + newStatus + ".");
}
示例13: onStatusChanged
/**
* This method is called when a provider is unable to fetch a location. Called when the provider
* status changes.
*/
@Override
public void onStatusChanged(String provider, int status, Bundle extras) {
switch (status) {
case LocationProvider.OUT_OF_SERVICE:
if (location == null || location.getProvider().equals(provider)) {
location = null;
}
break;
case LocationProvider.TEMPORARILY_UNAVAILABLE:
if (location == null || location.getProvider().equals(provider)) {
}
break;
case LocationProvider.AVAILABLE:
break;
}
}
示例14: onStatusChanged
/** {@inheritDoc} */
@Override
public void onStatusChanged (String provider, int status, Bundle extras)
{
// Called when the provider status changes.
Log.d(TAG, "Provider status changed: " + provider + " status: "
+ status);
if (status == LocationProvider.AVAILABLE) {
// Do nothing, we should get a location update soon which will
// disable the listener.
} else if (status == LocationProvider.OUT_OF_SERVICE ||
status == LocationProvider.TEMPORARILY_UNAVAILABLE)
{
getLocationButton.setEnabled(true);
getLocationButton.setText(
getString(R.string.gps_element_acquire_unavailable));
locationManager.removeUpdates(locationListener);
}
}
示例15: onStatusChanged
@Override
public void onStatusChanged(String provider, int status, Bundle extras) {
// This is called when the GPS status changes
switch (status) {
case LocationProvider.OUT_OF_SERVICE:
//Log.w("myApp", "[#] GPSApplication.java - GPS Out of Service");
gpsunavailablehandler.removeCallbacks(unavailr); // Cancel the previous unavail countdown handler
GPSStatus = GPS_OUTOFSERVICE;
EventBus.getDefault().post(EventBusMSG.UPDATE_FIX);
//Toast.makeText( getApplicationContext(), "GPS Out of Service", Toast.LENGTH_SHORT).show();
break;
case LocationProvider.TEMPORARILY_UNAVAILABLE:
//Log.w("myApp", "[#] GPSApplication.java - GPS Temporarily Unavailable");
gpsunavailablehandler.removeCallbacks(unavailr); // Cancel the previous unavail countdown handler
GPSStatus = GPS_TEMPORARYUNAVAILABLE;
EventBus.getDefault().post(EventBusMSG.UPDATE_FIX);
//Toast.makeText( getApplicationContext(), "GPS Temporarily Unavailable", Toast.LENGTH_SHORT).show();
break;
case LocationProvider.AVAILABLE:
gpsunavailablehandler.removeCallbacks(unavailr); // Cancel the previous unavail countdown handler
//Log.w("myApp", "[#] GPSApplication.java - GPS Available: " + _NumberOfSatellites + " satellites");
break;
}
}