title: Android Nested Fragment: How to pass result values to nested child fragment
body: <p>Hi am working on nested fragments. My Activity having two Tabs called Frag1 and Frag2. The Frag1 has children Tab named FragA and Frag B. From FragA i am calling one activity and i am returning its result to Fragment Activity. So based on the result i need to reload or recreate the FragA. Please some one tell me, how to pass vales from ParentFragment's onActivityResult() to child Fragment FragA. Thanks in advance. </p>
  
  <p><strong>Top level fragment:</strong></p>
  
  <pre><code>@Override
  public View onCreateView(LayoutInflater inflater, ViewGroup container,
          Bundle savedInstanceState) {
      // TODO Auto-generated method stub
  
      mTabHost = new FragmentTabHost(getActivity());
      mTabHost.setup(getActivity(), getChildFragmentManager(), R.layout.fragment_tabhost);
  
      arg1 = new Bundle();
      arg1.putString("tab", "tab1");
      mTabHost.addTab(mTabHost.newTabSpec("Tab1").setIndicator("Tab1"),
              FragmentTestA.class, arg1);
  
      arg1 = new Bundle();
      arg1.putString("tab", "tab2");
      mTabHost.addTab(mTabHost.newTabSpec("Tab2").setIndicator("Tab2"),
              FragmentTestB.class, arg1);
  
      arg1 = new Bundle();
      arg1.putString("tab", "tab3");
      mTabHost.addTab(mTabHost.newTabSpec("Tab3").setIndicator("Tab3"),
              FragmentTestC.class, arg1);
  
      return mTabHost;
  }
  </code></pre>
  
  <p><strong>FragmentTestA</strong>:</p>
  
  <pre><code> @Override
  public View onCreateView(LayoutInflater inflater, ViewGroup container,
          Bundle savedInstanceState) {
      // TODO Auto-generated method stub
      mainView = inflater.inflate(R.layout.frag, null);
  
      // initially load default fragment here
      fg = new DefaultFragment();
      replaceFragment(fg);
  
      if (getArguments() != null) {
          mCurrentTab = getArguments().getString("tab");
      }
  
      mNotUsedBtn = (Button) mainView.findViewById(R.id.btn2);
      mNotUsedBtn.setOnClickListener(new OnClickListener() {
  
          @Override
          public void onClick(View v) {
              // TODO Auto-generated method stub
          }
      });
  
      mUsedBtn = (Button) mainView.findViewById(R.id.btn3);
      mUsedBtn.setOnClickListener(new OnClickListener() {
  
          @Override
          public void onClick(View v) {
              // TODO Auto-generated method stub
          }
      });
  
      return mainView;
  }
  </code></pre>
  
  <p><strong>DefaultFragment:</strong></p>
  
  <pre><code>      @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
          Bundle savedInstanceState) {
      // TODO Auto-generated method stub
      mainView = inflater.inflate(R.layout.deal_list, null);
  
      mExpSoon = getArguments() != null ? 
              getArguments().getString("expiring_soon") : "";
      mStatus = getArguments() != null ? 
              getArguments().getString("status") : "";
      mCurrentTab = getArguments() != null ? 
              getArguments().getString("tab") : "";
          mListView.setOnItemClickListener(new OnItemClickListener() {
  
          @Override
          public void onItemClick(AdapterView&lt;?&gt; parent, View v, int position,
                  long id) {
              // TODO Auto-generated method stub
                 Calling Activity from here
          }
      }); 
  
  
  
      return mainView;
  }
  </code></pre>
  
  <p>So the intent called and it returns some result. how do we pass values to the last child to perform action based on the result. I am getting result to onActivityResult() from this how to send data to last activity.</p>