How to use the widget handle network components?
<p>Have a code to disable and enable Wi-Fi adapter:</p>

<pre><code>String service = Context.WIFI_SERVICE;
    wifi = (WifiManager)getSystemService(service);

public void Connected(){

        if (!wifi.isWifiEnabled()){
            if (wifi.getWifiState() != WifiManager.WIFI_STATE_ENABLING)                 
            wifi.setWifiEnabled(true);

        }
</code></pre>

<p>But how to implement it in a widget?</p>
