Start Androids WiFi-Manager by sending an intent?

半城伤御伤魂 提交于 2019-12-05 01:06:59

问题


I´m developing an application, where I´d like to have a button, which opens Androids built-in WiFi menu... (I don´t really want to implement scanning and connecting code by myself).

Is there any Intent I can send which opens this menu?


回答1:


You should use ACTION_PICK_WIFI_NETWORK action:

startActivity(new Intent(WifiManager.ACTION_PICK_WIFI_NETWORK));



回答2:


Also, if you want to implement it yourself (so it looks like your app), the Android SDK offers the WifiManager-class, which should do most of the work for you.




回答3:


If you want to open the default Wifi settings dialog, you can use an intent with an ACTION_WIFI_SETTINGS action



来源:https://stackoverflow.com/questions/6103122/start-androids-wifi-manager-by-sending-an-intent

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!