How to enable/disable WiFi from an application?

后端 未结 6 2172
说谎
说谎 2020-12-02 15:31

I want to enable/disable wifi from my Android application. How can I do that?

6条回答
  •  天涯浪人
    2020-12-02 16:18

    try this code

     Intent gpsOptionsIntent = new Intent(  android.provider.Settings.ACTION_WIFI_SETTINGS);  
                startActivityForResult(gpsOptionsIntent,0); 
    

提交回复
热议问题