title: How to enable and disable GCM in android?
body: <p>I am using GCM for push notifications in my application. I have a screen where the user has the facility to enable or disable notifications.<br>
  Can anyone please tell me how to enable and disable GCM programmatically.</p>
  
  <p>I had seen the below code from this post  <a href="https://stackoverflow.com/questions/14069967/android-gcm-enable-and-disable">Android GCM Enable/Disable</a> but it is not clear about the <strong>receiver</strong>.</p>
  
  <pre><code>PackageManager pm = getApplicationContext().getPackageManager();
  pm.setComponentEnabledSetting(receiver,
  PackageManager.COMPONENT_ENABLED_STATE_ENABLED,PackageManager.DONT_KILL_APP);
  </code></pre>
  
  <p>Thanks in advance.</p>