title: Can I turn on WiFi-Direct from code? on Android API-14 (ICS)
body: <p>I'm using the new Wi-Fi Direct API from google on Android 4.0 
  and in Sample code they send the User to Settings, to activate WiFi -Direct Mode.</p>
  
  <p>Is there a way to Start it by code??? </p>
  
  <p>all they offer is to listen to WIFI_P2P_STATE_CHANGED_ACTION intent, and then use this code</p>
  
  <pre><code>String action = intent.getAction();
  
  if (WifiP2pManager.WIFI_P2P_STATE_CHANGED_ACTION.equals(action)) {
  
     // UI update to indicate wifi p2p status.
     int state = intent.getIntExtra(WifiP2pManager.EXTRA_WIFI_STATE, -1);
  
     if (state == WifiP2pManager.WIFI_P2P_STATE_ENABLED) {
         // Wifi Direct mode is enabled
  
     } else {
         // Wifi Direct mode is disabled
     }
  </code></pre>