當前位置: 首頁>>代碼示例>>Java>>正文


Java LocationListener.onLocationChanged方法代碼示例

本文整理匯總了Java中com.google.android.gms.location.LocationListener.onLocationChanged方法的典型用法代碼示例。如果您正苦於以下問題:Java LocationListener.onLocationChanged方法的具體用法?Java LocationListener.onLocationChanged怎麽用?Java LocationListener.onLocationChanged使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.google.android.gms.location.LocationListener的用法示例。


在下文中一共展示了LocationListener.onLocationChanged方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onLocationChanged

import com.google.android.gms.location.LocationListener; //導入方法依賴的package包/類
@Override
public void onLocationChanged(Location location) {
    lastLocation = location;
    LocationListener listener;
    for(int i = 0; i < listeners.size(); i++) {
        listener = listeners.get(i);
        if(listener != null) {
            listener.onLocationChanged(location);
        }
    }
}
 
開發者ID:RSDT,項目名稱:Japp16,代碼行數:12,代碼來源:LocationProviderService.java

示例2: onLocationChanged

import com.google.android.gms.location.LocationListener; //導入方法依賴的package包/類
@Override
public void onLocationChanged(Location location) {
    // set current location
    currentLocation = location;
    // notify listener
    for(LocationListener locationListener : locationListeners) {
        locationListener.onLocationChanged(location);
    }
}
 
開發者ID:maciekjanusz,項目名稱:compass-project,代碼行數:10,代碼來源:LocationRetriever.java

示例3: onLocationChanged

import com.google.android.gms.location.LocationListener; //導入方法依賴的package包/類
@Override
public void onLocationChanged(final Location location) {
    AndroidDevicePacket newPacket = new AndroidDevicePacket(deviceId, location);
    if (lastSentPacket != null)
        if (location.getAccuracy() < Settings.getSetting(Settings.FilterAccuracyThreshold)) {
            if (!gpsFilter.NavigationFilterWork(lastSentPacket, newPacket)) {
                Log.i("Location received and filtered by GPS filter: " + Helpers.locationToString(location));
                return;
            }
        } else if (!lbsFilter.NavigationFilterWork(lastSentPacket, newPacket)) {
            Log.i("Location received and filtered by LBS filter: " + Helpers.locationToString(location));
            return;
        }

    Log.i("Location received and applied: " + Helpers.locationToString(location));

    lastSentPacket = newPacket;
    this.location = location;

    lastLocationTime = SystemClock.elapsedRealtime();

    AndroidDevicePacketsSender.Instance.addPacket(newPacket);

    for (LocationListener listener : locationListeners)
        listener.onLocationChanged(location);
    updateNotification();
}
 
開發者ID:Scoutgps,項目名稱:Scout-Tracker,代碼行數:28,代碼來源:TrackingService.java

示例4: onLocationChanged

import com.google.android.gms.location.LocationListener; //導入方法依賴的package包/類
@Override
public void onLocationChanged(Location location) {
    for (LocationListener listener : mListeners) {
        listener.onLocationChanged(location);
    }
}
 
開發者ID:suomenriistakeskus,項目名稱:oma-riista-android,代碼行數:7,代碼來源:LocationClient.java

示例5: onLocationChanged

import com.google.android.gms.location.LocationListener; //導入方法依賴的package包/類
@Override
public void onLocationChanged(Location location) {
    for (LocationListener listener : locationListeners)
        listener.onLocationChanged(location);
}
 
開發者ID:Scoutgps,項目名稱:Scout-Tracker,代碼行數:6,代碼來源:App.java


注:本文中的com.google.android.gms.location.LocationListener.onLocationChanged方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。