title: How do I pass a boolean value from my Main Activity to a fragment?
body: <p>I am trying to pass a boolean value to a map fragment so that location updates will be requested only when this boolean value is false.</p>
  
  <p>The value of this boolean value changes on the event of a button click.</p>
  
  <p><strong>RequestLocationUpdatesListener</strong> (interface)</p>
  
  <pre><code>public interface RequestLocationUpdatesListener {
          void onRequestLocationUpdates(boolean recording);
      }
  </code></pre>
  
  <p><strong>Requesting Location Updates</strong> (Main Activity)</p>
  
  <pre><code> // Turn on location updates and pass to fragment
   mButtonRecord.setOnClickListener(new OnClickListener() {
              @Override
              public void onClick(View v) {
                  Log.d(TAG_CONTEXT, "Start Recording clicked.");
                  mRequestLocationUpdates = true; // boolean value
                  mRequestingLocationUpdates = new RequestLocationUpdatesListener() {
                      @Override
                      public void onRequestLocationUpdates(boolean recording) {
                          recording = mRequestLocationUpdates;
                          mRequestingLocationUpdates.onRequestLocationUpdates(recording);
                      }
                  };
              }
          });
  </code></pre>
  
  <p><strong>Map Fragment</strong></p>
  
  <p>The Log.i is never accessed in my MapFragment, what am I missing?</p>
  
  <pre><code>@Override
      public void onRequestLocationUpdates(boolean recording) {
          Log.i(TAG_CONTEXT, "Recording? = " + recording);
      }
  </code></pre>