I have a class in my project
public class LocateMe {
public void locateMe(Activity activity) {
mLocationClient = new FusedLocationProviderClient(activity);
.....
that uses FusedLocationProviderClient but I keep getting the warning "This method should only be accessed from tests or within package private scope" about the line new FusedLocationProviderClient(activity). I tried to tweak and change things without success.
Use the following way to initialize it instead:
mLocationClient = LocationServices.getFusedLocationProviderClient(getApplicationContext());
or use whatever context you got.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With