title: Broadcast not received by activity
body: <p>This is the most similar question I found <a href="https://stackoverflow.com/questions/9376715/broadcastreceiver-not-receiving-broadcast">here</a>, but I can't get it working, can somebody help me?</p>
  
  <p>ConectivityChange.java</p>
  
  <pre><code>public static final String MSG_EVENT = "com.example.miguel.broadcast.EVENT";
  
  // onCreate...
  Intent intent = new Intent(context, MainActivity.class);
  intent.setAction(MSG_EVENT);
  intent.putExtra("type", "connection");
  intent.putExtra("connected", networkConn);
  intent.putExtra("network", 1);
  intent.putExtra("name", ssid);
  context.sendBroadcast(intent);
  </code></pre>
  
  <p>MainActivity.java</p>
  
  <pre><code>public static final String MSG_EVENT = "com.example.miguel.broadcast.EVENT";
  
  public class MyBroadcastReceiver extends BroadcastReceiver {
      @Override
      public void onReceive(Context context, Intent intent) {
          Log.i(TAG, "Message");
      }
  }
  
  MyBroadcastReceiver mReceiver = new MyBroadcastReceiver();
  
  @Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
  
      IntentFilter filter = new IntentFilter();
      filter.addAction(MSG_EVENT);
      registerReceiver(mReceiver, filter);
  }
  </code></pre>
  
  <p>AndroidManifiest.java</p>
  
  <pre><code>&lt;activity android:name=".MainActivity" android:label="@string/app_name" &gt;
      &lt;intent-filter&gt;
          &lt;action android:name="android.intent.action.MAIN" /&gt;
          &lt;action android:name="com.example.miguel.broadcast.EVENT" /&gt;
          &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
      &lt;/intent-filter&gt;
  &lt;/activity&gt;
  </code></pre>