如何使用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));