title: Getting what has changed in ContentObserver
body: <p>I want to know if the volume has changed. Reading other post I found this code to register a ContentObserver and get an event when something changes. 
  My problem is that I don't know how to know what has changed. I mean, I get an OnReceive() but how can I get the extra information (what volume key was pressed, for example).</p>
  
  <p>I also get a lot of unneeded events, for example, clicking on the "Menu" button triggers this event too, but nothing has changed (yet).</p>
  
  <p>This is my code.</p>
  
  <p>Thank you</p>
  
  <pre><code>public class clsSettingsContentObserver extends ContentObserver
  {
     public Context Contexto=null; //This is for displaying Toasts
  
     public clsSettingsContentObserver(Handler handler)
     {  super(handler);
     } 
  
  
     @Override public boolean deliverSelfNotifications()
     {
        return super.deliverSelfNotifications(); 
     }
  
  
     @Override public void onChange(boolean selfChange)
     {  super.onChange(selfChange);
  
        //How do I get more info here?????
        ShowToast("Settings change detected");    
     }
  
  
     private void ShowToast(String strMensaje)
     {  Toast toast1 = Toast.makeText(Contexto, strMensaje, Toast.LENGTH_SHORT);
        toast1.show();   
     };
  
  }
  </code></pre>
  
  <p>And this is how I register it:</p>
  
  <pre><code>clsSettingsContentObserver oSettingsContentObserver = new clsSettingsContentObserver( new Handler() );
  oSettingsContentObserver.Contexto = this; //This is for displaying Toasts
  getApplicationContext().getContentResolver().registerContentObserver(
              android.provider.Settings.System.CONTENT_URI,
              true, 
              oSettingsContentObserver);
  </code></pre>