当前位置: 首页>>代码示例>>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;未经允许,请勿转载。