Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
920 views
in Technique[技术] by (71.8m points)

wifi - How to call Wi-Fi settings screen from my application using 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.

Question&Answers:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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

EDIT: Add the coding line.

startActivity(new Intent(Settings.ACTION_WIFI_SETTINGS));


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...