title: POWER connected and disconnected listeners
body: <p>I am listening to both connecting and disonnecting the power for my galaxy.</p>
  
  <p>I have creatd 2 BroadCastReceivers, one for connect, and one for disconnect.</p>
  
  <p>When I try to implement, I only get the connected data, even when disconnecting the power cable.</p>
  
  <p>The intent is sent, but looks like it's the wrong one.</p>
  
  <p>Here is the activity code:</p>
  
  <pre><code>        //      Handle Power On
      PowerConnectedBCReceiver myPowerConnectedBCReceiver = new PowerConnectedBCReceiver();
      IntentFilter intentPowerOnFilter = new IntentFilter();
      intentPowerOnFilter.addAction("android.intent.action.ACTION_POWER_CONNECTED");
      registerReceiver(myPowerConnectedBCReceiver, intentPowerOnFilter);
  
      BroadcastReceiver PowerConnectedReceiver = new BroadcastReceiver() {
          @Override
          public void onReceive(Context context, Intent intent) {
              showToast("connected");
          }
      };
  
  
  
      //      Handle Power Off
      PowerConnectedBCReceiver myPowerDisonnectedBCReceiver = new PowerConnectedBCReceiver();
      IntentFilter intentPowerDisconnectedOnFilter = new IntentFilter();
      intentPowerDisconnectedOnFilter.addAction("android.intent.action.ACTION_POWER_DISCONNECTED");
      registerReceiver(myPowerDisonnectedBCReceiver, intentPowerDisconnectedOnFilter);
  
      BroadcastReceiver PowerDisconnectedReceiver = new BroadcastReceiver() {
          @Override
          public void onReceive(Context context, Intent intent) {
              showToast("disconnected");
          }
      };
  </code></pre>
  
  <p>Registering both BC to do the work</p>
  
  <pre><code>        registerReceiver(PowerDisconnectedReceiver, new IntentFilter("com.neglected.POWER_DISCONNECTED"));
      registerReceiver(PowerConnectedReceiver, new IntentFilter("com.neglected.POWER_CONNECTED"));
  </code></pre>
  
  <p>BroadCast connected code:</p>
  
  <pre><code>public class PowerConnectedBCReceiver extends BroadcastReceiver
  { 
  @Override
  public void onReceive(Context context, Intent intent) 
  {
      Toast.makeText(context,  "Phone was connected to power" , Toast.LENGTH_LONG).show();
      Intent tIntent = new Intent("com.neglected.POWER_CONNECTED");
      context.sendBroadcast(tIntent);
  } 
  </code></pre>
  
  <p>} </p>
  
  <p>Broadcast disconnected code: </p>
  
  <pre><code>public class PowerDisconnectedBCReceiver extends BroadcastReceiver
  { 
  @Override
  public void onReceive(Context context, Intent intent) 
  {
  
      Toast.makeText(context,  "Phone was disconnected from power" , Toast.LENGTH_LONG).show();
      Intent tIntent = new Intent("com.neglected.POWER_DISCONNECTED");
      context.sendBroadcast(tIntent);
  } 
  </code></pre>
  
  <p>} </p>
  
  <p>IS the code wrong?
  Can I listen to both actions? seperately?
  I can't see extra been sent with the CONNNECTED Action, is there?</p>