title: how to get callback from fragment to fragment
body: <p>I have two fragment Parent and child, And Now I am trying to get some value from childFragment to parentFragment using callback.</p>
  
  <p>Here is what i have tried so far:</p>
  
  <p><strong>Adding childfragment</strong> </p>
  
  <pre><code> activity.getSupportFragmentManager()
                  .beginTransaction()
                  .replace(R.id.frame_layout, fragment).addToBackStack(null)
                  .commit();
  </code></pre>
  
  <p>Now on buttonClick of childFragment i want to get response to parentFragment.</p>
  
  <p><strong>Example:</strong></p>
  
  <pre><code>nearestCenter.setOnClickListener(new View.OnClickListener() {
      @Override
      public void onClick(View v) {
             if (getFragmentManager() != null) {
          getFragmentManager().popBackStack();
      }
      }
  });
  </code></pre>
  
  <p><strong>P.S</strong>
  I know how to do with Activity to Fragment but is there any way to get callback from fragment to frag.</p>