有什么方法可以将凌空整合到requestLocationUpdates()中吗?

时间:2020-06-12 11:58:58

标签: android service background-service

如何在此方法上集成排球?我是Android的新手,很难过,这是服务类的一部分,我想插入一个齐射来激活它,并单击一下按钮。请帮助我

public void requestLocationUpdates() { 
    Common.setRequestingLocationUpdates(this, true);
    startService(new Intent(getApplicationContext(), BackgroundService.class));
    if (mLocation != null)
        insertdata();
    try {
        fusedLocationProviderClient.requestLocationUpdates(locationRequest, locationCallback ,Looper.myLooper());
    }catch (SecurityException ex)
    {
        Log.e("Err1", "Lost location permission.Could not request it "+ex);
    }
}

0 个答案:

没有答案