本文整理汇总了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());
}
}
示例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--;
}
}
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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;
}
示例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());
}
示例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));
}