小编Mat*_*lho的帖子

如何防止服务被破坏

我有一个Service跟踪用户的位置,在我得到用户的位置的时候GoogleApiClient.

它发生了一些Service停止,依赖互联网或模型电话Service停止向webservice发送位置.好像被摧毁了.

我怎么能阻止这个?

public class LocationService extends Service implements
        GoogleApiClient.ConnectionCallbacks,
        GoogleApiClient.OnConnectionFailedListener,
        LocationListener {

    private static final String TAG = "LocationService";
    public long UPDATE_MILLISECONDS_DEFAULT = 180000;

    private boolean currentlyProcessingLocation = false;
    private LocationRequest locationRequest;
    private GoogleApiClient googleApiClient;

    @Override
    public void onCreate() {
        Log.d(TAG,"Location service create");
        super.onCreate();
    }

    @Override
    public int onStartCommand(Intent intent, int flags, int startId) {
        // if we are currently trying to get a location and the alarm manager has called …
Run Code Online (Sandbox Code Playgroud)

android

3
推荐指数
1
解决办法
1678
查看次数

在 Mapbox 服务中找不到 GeocoderAutoCompleteView

我正在尝试使用MapBox 服务通过 GeoCoding 和 AutoComplete 建议用户附近的地点:

compile ('com.mapbox.mapboxsdk:mapbox-android-sdk:5.0.2@aar'){
    transitive=true
}
compile ('com.mapbox.mapboxsdk:mapbox-android-services:2.0.0@aar'){
    transitive=true
}
Run Code Online (Sandbox Code Playgroud)

但是像 GeocoderAutoCompleteView 这样的一些类不包含在这个包中,我无法导入该类。

android mapbox

1
推荐指数
1
解决办法
466
查看次数

标签 统计

android ×2

mapbox ×1