title: Broadcast message not being received
body: <p>I'm trying to create a widget with 2 clickable buttons, which have their handlers attached to them using the onUpdate method in the AppWidgetProvider. However, The broadcast messages arn't being received. Anyone got any idea?</p>
  
  <p>MainActivity:</p>
  
  <pre><code>public class MainActivity extends ActionBarActivity implements View.OnClickListener {
      private static final String TAG = "MainActivity";
  
      private IRThread irThread;
  
      private Handler handler;
      private boolean onOff = false;
      private static HashMap&lt;Integer, Integer&gt; codeLookup = new HashMap&lt;&gt;();
      static {
          codeLookup.put(R.id.up_button, AuraGlowCodes.BRIGHTNESS_UP);
          codeLookup.put(R.id.down_button, AuraGlowCodes.BRIGHTNESS_DOWN);
  
          codeLookup.put(R.id.green_button, AuraGlowCodes.COLOR_GREEN);
          codeLookup.put(R.id.red_button, AuraGlowCodes.COLOR_RED);
          codeLookup.put(R.id.blue_button, AuraGlowCodes.COLOR_BLUE);
          codeLookup.put(R.id.red_button_2, AuraGlowCodes.COLOR_RED_2);
          codeLookup.put(R.id.blue_button_2, AuraGlowCodes.COLOR_BLUE_2);
          codeLookup.put(R.id.green_button_2, AuraGlowCodes.COLOR_GREEN_2);
          codeLookup.put(R.id.red_button_3, AuraGlowCodes.COLOR_RED_3);
          codeLookup.put(R.id.blue_button_3, AuraGlowCodes.COLOR_BLUE_3);
          codeLookup.put(R.id.green_button_3, AuraGlowCodes.COLOR_GREEN_3);
          codeLookup.put(R.id.red_button_4, AuraGlowCodes.COLOR_RED_4);
          codeLookup.put(R.id.blue_button_4, AuraGlowCodes.COLOR_BLUE_4);
          codeLookup.put(R.id.green_button_4, AuraGlowCodes.COLOR_GREEN_4);
  
          codeLookup.put(R.id.flash_button, AuraGlowCodes.PATTERN_FLASH);
          codeLookup.put(R.id.fade_button, AuraGlowCodes.PATTERN_FADE);
          codeLookup.put(R.id.smooth_button, AuraGlowCodes.PATTERN_SMOOTH);
          codeLookup.put(R.id.strobe_button, AuraGlowCodes.PATTERN_STROBE);
  
  
      }
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
          irThread = new IRThread(getApplicationContext());
          handler = irThread.getHandler();
  
          findViewById(R.id.onOff_button).setOnClickListener(this);
          findViewById(R.id.up_button).setOnClickListener(this);
          findViewById(R.id.down_button).setOnClickListener(this);
  
          findViewById(R.id.red_button).setOnClickListener(this);
          findViewById(R.id.green_button).setOnClickListener(this);
          findViewById(R.id.blue_button).setOnClickListener(this);
  
          findViewById(R.id.red_button_2).setOnClickListener(this);
          findViewById(R.id.green_button_2).setOnClickListener(this);
          findViewById(R.id.blue_button_2).setOnClickListener(this);
  
          findViewById(R.id.red_button_3).setOnClickListener(this);
          findViewById(R.id.green_button_3).setOnClickListener(this);
          findViewById(R.id.blue_button_3).setOnClickListener(this);
  
          findViewById(R.id.red_button_4).setOnClickListener(this);
          findViewById(R.id.green_button_4).setOnClickListener(this);
          findViewById(R.id.blue_button_4).setOnClickListener(this);
  
          findViewById(R.id.flash_button).setOnClickListener(this);
          findViewById(R.id.fade_button).setOnClickListener(this);
          findViewById(R.id.strobe_button).setOnClickListener(this);
          findViewById(R.id.smooth_button).setOnClickListener(this);
  
          Intent intent = new Intent(this, WidgetProvider.class);
          intent.setAction(AppWidgetManager.ACTION_APPWIDGET_UPDATE);
          sendBroadcast(intent);
          Log.e("[HERE]", "SENT BROADCAST");
      }
  
      @Override
      public void onClick(View v) {
          int val = 0;
  
          switch (v.getId()){
              case R.id.onOff_button:
                  if (onOff){
                      val = AuraGlowCodes.TURN_OFF;
                  } else {
                      val = AuraGlowCodes.TURN_ON;
                  }
                  onOff=!onOff;
                  break;
              default:
                  val = codeLookup.get(v.getId());
                  break;
          }
          Log.wtf("[fuck]", Integer.toHexString(val));
  
          int[] pattern = NECFactory
                  .createCommand()
                  .addInteger(val, (byte)32)
                  .getPattern(5);
          Message msg = handler.obtainMessage(IRThread.MSG_NAME, pattern);
          handler.sendMessage(msg);
  
      }
  }
  </code></pre>
  
  <p>AndroidManifest:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="io.github.dadude941.auraglowremote"&gt;
  
      &lt;uses-permission android:name="android.permission.TRANSMIT_IR" /&gt;
  
      &lt;application
          android:allowBackup="true"
          android:icon="@drawable/ic_launcher"
          android:label="@string/app_name"
          android:theme="@style/AppTheme"&gt;
          &lt;activity
              android:name=".ui.MainActivity"
              android:label="@string/app_name"&gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="android.intent.action.MAIN" /&gt;
  
                  &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
              &lt;/intent-filter&gt;
          &lt;/activity&gt;
          &lt;receiver android:name="io.github.dadude941.auraglowremote.ui.WidgetProvider" &gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="android.appwidget.action.APPWIDGET_UPDATE" /&gt;
              &lt;/intent-filter&gt;
              &lt;meta-data android:name="android.appwidget.provider"
                  android:resource="@xml/example_appwidget_info" /&gt;
          &lt;/receiver&gt;
      &lt;/application&gt;
  
  
  &lt;/manifest&gt;
  </code></pre>
  
  <p>WidgetProvider.java:</p>
  
  <pre><code>package io.github.dadude941.auraglowremote.ui;
  
  import android.app.PendingIntent;
  import android.appwidget.AppWidgetManager;
  import android.appwidget.AppWidgetProvider;
  import android.content.Context;
  import android.content.Intent;
  import android.util.Log;
  import android.view.View;
  import android.widget.RemoteViews;
  
  import io.github.dadude941.auraglowremote.R;
  
  /**
   * Created by Miguel Boland on 06/03/2015.
   */
      public class WidgetProvider extends AppWidgetProvider {
      public final static String WIDGET_ON_BUTTON = "MY_PACKAGE_NAME.WIDGET_BUTTON";
      public final static String WIDGET_OFF_BUTTON = "MY_PACKAGE_NAME.WIDGET_BUTTON2";
  
      @Override
      public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds){
          Log.e("[onUpdate]", "UPDATING");
          Intent intent = new Intent(WIDGET_ON_BUTTON);
          PendingIntent pendingIntent = PendingIntent.getBroadcast(context, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);
          RemoteViews remoteViews = new RemoteViews(context.getPackageName(), R.layout.widget);
          remoteViews.setOnClickPendingIntent(R.id.on_button, pendingIntent);
  
          Intent intent2 = new Intent(WIDGET_OFF_BUTTON);
          PendingIntent pendingIntent2 = PendingIntent.getBroadcast(context, 0, intent2, PendingIntent.FLAG_UPDATE_CURRENT);
          remoteViews.setOnClickPendingIntent(R.id.off_button, pendingIntent2);
  
      }
  
      @Override
      public void onReceive(Context context, Intent intent){
          switch(intent.getAction()){
              case WIDGET_ON_BUTTON:
                  Log.e("[onReceive]", "ON BUTTON");
                  break;
  
              case WIDGET_OFF_BUTTON:
                  Log.e("[onReceive]", "OFF BUTTON");
                  break;
          }
      }
  }
  </code></pre>