【问题标题】:how can i enable GPS without redirecting the user to the settings screen?如何在不将用户重定向到设置屏幕的情况下启用 GPS?
【发布时间】:2016-10-18 13:26:17
【问题描述】:

我想像谷歌地图一样启用用户的位置,在 appcelerator studio 中可以吗? (不将用户重定向到设置屏幕)

【问题讨论】:

    标签: appcelerator appcelerator-titanium appcelerator-alloy


    【解决方案1】:

    你可以尝试一下:

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

    参考:https://stackoverflow.com/a/11503095/5193915

    但我认为它不适用于较新的设备。

    【讨论】:

    • 谢谢,但它确实不适用于新设备,我需要它。
    猜你喜欢
    • 2015-06-26
    • 1970-01-01
    • 2015-07-13
    • 1970-01-01
    • 2010-10-29
    • 1970-01-01
    • 2016-11-21
    • 2017-07-09
    相关资源
    最近更新 更多