title: getting battery level at android widget
body: <p>I wrote a widget for Android and I'm trying to get the battery level.
  I've tried using</p>
  
  <pre><code>Intent batteryIntent = context.registerReceiver(null, new IntentFilter(Intent.ACTION_BATTERY_CHANGED));
  </code></pre>
  
  <p>but I get the error:
  "IntentReceiver components are not allowed to register to receive intents"</p>
  
  <p>Why? the ACTION_BATTERY_CHANGED is a sticky intent and I don't register a receiver (null in the first parameter).</p>
  
  <p>Any workaround?</p>
  
  <p>Thanks.</p>