如何建立 wifi 连接?

发布于 2024-12-27 21:30:30 字数 195 浏览 3 评论 0原文

我想编写一个应用程序列表接入点,当您单击其中一个时,将打开一个 wifi 连接对话框(如 WiFi Manager 或 WiFinder),但我不知道如何打开默认连接对话框?以及如何接收意图或事件调用连接对话框?

需要明确的是,我想打开一个对话框,就像打开 Wi-Fi 设置时一样,单击已配置的 wifi 网络列表之一;它会打开一个对话框,询问您连接还是忘记。

I want to write a application list AccessPoints and when you click one, a wifi connection dialog will open (like WiFi Manager or WiFinder) but I don't know how to Open the default connection dialog ?and how to receive the intent or event to call the connection dialog?

To be clear, I want to open a dialog like when you open Wi-Fi setting, click on one of configured wifi network list; and it open a dialog asking you connect or forget.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

想你只要分分秒秒 2025-01-03 21:30:30

试试这个,

WifiManager wifi = (WifiManager) getSystemService(Context.WIFI_SERVICE);
wifi.setWifiEnabled(enabled);

Try this,

WifiManager wifi = (WifiManager) getSystemService(Context.WIFI_SERVICE);
wifi.setWifiEnabled(enabled);
对岸观火 2025-01-03 21:30:30

我想你想要这个:

startActivity(new Intent(WifiManager.ACTION_PICK_WIFI_NETWORK));

来自这里。下一篇文章还提到 WifiManager 它可以为您提供更好的控制,例如已配置网络的列表。

I think you want this:

startActivity(new Intent(WifiManager.ACTION_PICK_WIFI_NETWORK));

from here. The next post also mentions WifiManager which gives you finer control like a list of the configured networks.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文