title: What is faster Communicating, sending broadcast VS calling activity method directly in Android?
body: <p>In my app, I have to call an activity method from the fragment.</p>
  
  <p>I know I can do this in two ways:</p>
  
  <p><strong>1. Via sending a broadcast to activity:</strong></p>
  
  <p><code>Intent intent = new Intent("FILTER");
   intent.putExtra("EXTRA", 1);
   sendBroadcast(intent);</code></p>
  
  <p><strong>2. Or Calling the activity method directly:</strong></p>
  
  <p><code>((MyActivity) getActivity()).method();</code></p>
  
  <p>I would like to know which way is faster and safe to communicate. Any help would be appreciated.</p>
  
  <p>Thank you.</p>