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.

Is there a way to Start it by code??? 

all they offer is to listen to WIFI\_P2P\_STATE\_CHANGED\_ACTION intent, and then use this 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
   }

```