【问题标题】:Is it possible to activate the mobile network manually?是否可以手动激活移动网络?
【发布时间】:2012-02-21 02:32:52
【问题描述】:

我正在开发一个 GPS 应用程序。我想手动启用等效于settings location and security -> Use wireless network 我想手动启用该选项。这可能吗?

【问题讨论】:

  • 我要开通移动网络

标签: android networking settings wireless


【解决方案1】:

这是激活wifi

WifiManager wifiManager = (WifiManager)getSystemService(Context.WIFI_SERVICE);
            wifiManager.setWifiEnabled(true);

添加此权限:

<uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/>

【讨论】:

    猜你喜欢
    • 2021-06-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-01-23
    • 1970-01-01
    相关资源
    最近更新 更多