how to disable location nag
- By pzbrawl
- Smartphones
- 2 Replies
On a LG V20 running Androud 8.0.0 with location services turned off, I'm getting annoying nags to turn on location services. Hiw do I stoo that?
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
package com.example.locationweatherapp.Data.Network.Service;
import android.view.View;
import android.widget.Toast;
import com.example.locationweatherapp.Data.Network.ApiClient;
import com.example.locationweatherapp.Data.Network.ApiInterface;
import com.example.locationweatherapp.Data.Network.Model.WeatherResult;
import com.example.locationweatherapp.Utility.Utils;
import com.squareup.picasso.Picasso;
import javax.inject.Inject;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.disposables.CompositeDisposable;
import io.reactivex.functions.Consumer;
import io.reactivex.schedulers.Schedulers;
public class WeatherCityNameServiceImp implements WeatherCityNameService {
private ApiInterface apiService;
CompositeDisposable compositeDisposable;
@Inject
public WeatherCityNameServiceImp() {
apiService = ApiClient.getClient().create(ApiInterface.class);
compositeDisposable = new CompositeDisposable();
}
@Override
public void weatherCityNameService(String cityName, final ServiceCallBack<WeatherResult> callBack) {
compositeDisposable.add(apiService.weatherCityNameService(cityName, Utils.APP_ID, "metric")
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Consumer<WeatherResult>() {
@Override
public void accept(WeatherResult weatherResult) throws Exception {
callBack.onResponse(weatherResult);
}
}, new Consumer<Throwable>() {
@Override
public void accept(Throwable throwable) throws Exception {
callBack.onError(throwable.getMessage());
}
})
);
}
}