Max Zhukov
Max Zhukov

Reputation: 897

Enable Wi-Fi and Bluetooth programmatically

I need write handlers of 2buttons to enable/disable wifi and bluetooth. Now, I can only see phone settings page, where I can change enable/disable wifi and bluetooth manually. So, how can I do it programmatically?

Code for Wi-Fi:

        ConnectionSettingsTask connectionSettingsTask = new ConnectionSettingsTask();
        connectionSettingsTask.ConnectionSettingsType = ConnectionSettingsType.WiFi;
        connectionSettingsTask.Show();

Upvotes: 3

Views: 1323

Answers (1)

Hermit Dave
Hermit Dave

Reputation: 3046

other than showing the wifi / Bluetooth settings page, you cannot do anything else.

the user has to then toggle the button.

Upvotes: 3

Related Questions