如何使用Android从我的应用程序调用Wi-Fi设置屏幕 [英] How to call Wi-Fi settings screen from my application using Android

查看:92
本文介绍了如何使用Android从我的应用程序调用Wi-Fi设置屏幕的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

通常,我会通过单击Settings > Wireless controls > wifi settings在仿真器上获得Wi-Fi设置屏幕.按下我创建的Wi-Fi按钮时,我需要从程序直接进入Wi-Fi设置屏幕.我们可以使用Intent.setData(android.provider.contacts ......)处理的联系人,呼叫日志.有什么方法可以从Android程序中打开设置子菜单/菜单吗?
请给我建议或示例代码.

Normally I am getting Wi-Fi setting screen on the emulator by clicking on the Settings > Wireless controls > wifi settings. I need to go directly to the Wi-Fi settings screen from my program when pressing on the Wi-Fi button which I have created. Contacts, Call Logs we can handle by using Intent.setData(android.provider.contacts...........). Is there any way to open settings sub-menus/menu from an android program?
Please give me advise or sample code on this.

推荐答案

查看 android.provider.Settings 用于一系列Intent操作,您可以使用这些操作来启动各种设置屏幕(例如,ACTION_WIFI_SETTINGS).

Look at android.provider.Settings for a series of Intent actions you can use to launch various settings screens (e.g., ACTION_WIFI_SETTINGS).

编辑:添加编码行.

startActivity(new Intent(Settings.ACTION_WIFI_SETTINGS));

这篇关于如何使用Android从我的应用程序调用Wi-Fi设置屏幕的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆