当前位置: 首页>>代码示例>>Java>>正文


Java ILocationListener类代码示例

本文整理汇总了Java中com.google.android.gms.location.ILocationListener的典型用法代码示例。如果您正苦于以下问题:Java ILocationListener类的具体用法?Java ILocationListener怎么用?Java ILocationListener使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ILocationListener类属于com.google.android.gms.location包,在下文中一共展示了ILocationListener类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: requestLocationUpdates

import com.google.android.gms.location.ILocationListener; //导入依赖的package包/类
public void requestLocationUpdates(LocationRequest request, final LocationListener listener)
        throws RemoteException {
    if (nativeLocation != null) {
        nativeLocation.requestLocationUpdates(request, listener);
    } else {
        if (!listenerMap.containsKey(listener)) {
            listenerMap.put(listener, new ILocationListener.Stub() {
                @Override
                public void onLocationChanged(Location location) throws RemoteException {
                    listener.onLocationChanged(location);
                }
            });
        }
        getServiceInterface().requestLocationUpdatesWithPackage(request,
                listenerMap.get(listener), getContext().getPackageName());
    }
}
 
开发者ID:microg,项目名称:android_external_GmsLib,代码行数:18,代码来源:LocationClientImpl.java

示例2: removeLocationUpdates

import com.google.android.gms.location.ILocationListener; //导入依赖的package包/类
public void removeLocationUpdates(ILocationListener listener, String packageName) {
    for (int i = 0; i < currentRequests.size(); i++) {
        if (currentRequests.get(i).respondsTo(listener)) {
            removeLocationUpdates(currentRequests.get(i));
            i--;
        }
    }
}
 
开发者ID:microg,项目名称:android_packages_apps_GmsCore,代码行数:9,代码来源:GoogleLocationManager.java

示例3: requestLocationUpdatesWithListener

import com.google.android.gms.location.ILocationListener; //导入依赖的package包/类
@Override
public void requestLocationUpdatesWithListener(LocationRequest request,
                                               final ILocationListener listener) throws RemoteException {
    Log.d(TAG, "requestLocationUpdatesWithListener: " + request);
    getLocationManager().requestLocationUpdates(request, listener, null);
}
 
开发者ID:microg,项目名称:android_packages_apps_GmsCore,代码行数:7,代码来源:GoogleLocationManagerServiceImpl.java

示例4: removeLocationUpdatesWithListener

import com.google.android.gms.location.ILocationListener; //导入依赖的package包/类
@Override
public void removeLocationUpdatesWithListener(ILocationListener listener)
        throws RemoteException {
    Log.d(TAG, "removeLocationUpdatesWithListener: " + listener);
    getLocationManager().removeLocationUpdates(listener, null);
}
 
开发者ID:microg,项目名称:android_packages_apps_GmsCore,代码行数:7,代码来源:GoogleLocationManagerServiceImpl.java

示例5: requestLocationUpdatesWithPackage

import com.google.android.gms.location.ILocationListener; //导入依赖的package包/类
@Override
public void requestLocationUpdatesWithPackage(LocationRequest request, ILocationListener listener,
                                              String packageName) throws RemoteException {
    Log.d(TAG, "requestLocationUpdatesWithPackage: " + request);
    getLocationManager().requestLocationUpdates(request, listener, packageName);
}
 
开发者ID:microg,项目名称:android_packages_apps_GmsCore,代码行数:7,代码来源:GoogleLocationManagerServiceImpl.java

示例6: requestLocationUpdatesInternalWithListener

import com.google.android.gms.location.ILocationListener; //导入依赖的package包/类
@Override
public void requestLocationUpdatesInternalWithListener(LocationRequestInternal request,
                                                       ILocationListener listener) throws RemoteException {
    Log.d(TAG, "requestLocationUpdatesInternalWithListener: " + request);
    getLocationManager().requestLocationUpdates(request.request, listener, null);
}
 
开发者ID:microg,项目名称:android_packages_apps_GmsCore,代码行数:7,代码来源:GoogleLocationManagerServiceImpl.java

示例7: LocationRequestHelper

import com.google.android.gms.location.ILocationListener; //导入依赖的package包/类
public LocationRequestHelper(Context context, LocationRequest locationRequest, boolean hasFinePermission,
                             boolean hasCoarsePermission, String packageName, ILocationListener listener) {
    this(context, locationRequest, hasFinePermission, hasCoarsePermission, packageName);
    this.listener = listener;
}
 
开发者ID:microg,项目名称:android_packages_apps_GmsCore,代码行数:6,代码来源:LocationRequestHelper.java

示例8: respondsTo

import com.google.android.gms.location.ILocationListener; //导入依赖的package包/类
public boolean respondsTo(ILocationListener listener) {
    return this.listener != null && listener != null &&
            this.listener.asBinder().equals(listener.asBinder());
}
 
开发者ID:microg,项目名称:android_packages_apps_GmsCore,代码行数:5,代码来源:LocationRequestHelper.java

示例9: requestLocationUpdates

import com.google.android.gms.location.ILocationListener; //导入依赖的package包/类
public void requestLocationUpdates(LocationRequest request, ILocationListener listener, String packageName) {
    requestLocationUpdates(new LocationRequestHelper(context, request, hasFineLocationPermission(),
            hasCoarseLocationPermission(), packageName, listener));
}
 
开发者ID:microg,项目名称:android_packages_apps_GmsCore,代码行数:5,代码来源:GoogleLocationManager.java


注:本文中的com.google.android.gms.location.ILocationListener类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。