'FusedLocationProviderClient, This method should only be accessed from tests or within package private scope

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.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source