title: Android Fragment - BroadcastReceiver call fragment method
body: <p>I have a BroadcastReceiver which receives broadcast sent to a Fragment.
  I'm getting the broadcast but how can I call a method from the Fragment itself?
  I basically need to update a List once the broadcast arrives, the List &amp; update method are part of the Fragment.</p>
  
  <pre><code>public class FragmentReceiver extends BroadcastReceiver
  {
      @Override
      public void onReceive(Context context, Intent intent) {
          String action = intent.getAction();
          if(action != null &amp;&amp; action.equals("AllTasksFragmentUpdate"))
          {
              //
          }
      }
  }
  </code></pre>
  
  <p><strong>Registering the receiver:</strong></p>
  
  <pre><code>    @Override
  public void onCreate(final Bundle savedInstanceState)
  {
      super.onCreate(savedInstanceState);
      getActivity().registerReceiver(new FragmentReceiver(), new IntentFilter("AllTasksFragmentUpdate"));
  }
  </code></pre>
  
  <p>How can I call the method from the Fragment?</p>