user2566468
user2566468

Reputation: 179

LocationManager and LOCATION_SERVICE

are these 2 lines equivalent? They behave differently in my application.

locationManager = (LocationManager) context.getSystemService(LOCATION_SERVICE);
locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);

Thanks

Upvotes: 2

Views: 4243

Answers (1)

tyczj
tyczj

Reputation: 73753

yes they are the same, the first would be from anything other than an Activity or a Service while the other would be from one of those 2.

Upvotes: 2

Related Questions