开发者

GPS disabling feature

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜