The error message means that you are using class ( Context) to call which instance class is required .
You need to pass the Context instance into getLocationand use this context instance to invoke getSystemService.
public static Location getLocation (Context context) {
LocationManager manager =
(LocationManager) context.getSystemService(Context.LOCATION_SERVICE);
If you use LocationManagerHelperfrom Activity, you can pass Activity as context:
LocationManagerHelper.getLocation(this);
source
share