开发者

GPS disabling feature

开发者 https://www.devze.com 2023-02-05 05:10 出处:网络
I am developing a app.. When i start the app my G开发者_运维技巧PS is enabled but on exit it should disable the GPS. how to do it? please helpYou can disable GPS by the given code.It is working well.

I am developing a app.. When i start the app my G开发者_运维技巧PS is enabled but on exit it should disable the GPS. how to do it? please help


You can disable GPS by the given code.It is working well.

Intent intent = new Intent("android.location.GPS_ENABLED_CHANGE");
intent.putExtra("enabled", false);
sendBroadcast(intent);


I don't think its not possible.

Try something like this:

LocationManager.removeUpdates(LocationListener);

I hope it is what you're looking for.


You need not disable anything , just remove gpsupdate using Location Manager.. Here the code for that

(LocationManager)getSystemService(Context.LOCATION_SERVICE).removeUpdates(mLocListener);

0

精彩评论

暂无评论...
验证码 换一张
取 消