title: How to call public void in Fragment from same Activity
body: <p>I want in the Actionbar button click change my Fragment page textView Text.</p>
  
  <p>I am using Activity and Fragment. in this Activity</p>
  
  <p>How to call public void in Fragment from same Activity? Thank all~</p>
  
  <p>Code</p>
  
  <blockquote>
    <p>MainActivity.java</p>
  </blockquote>
  
  <pre><code>public class MainActivity extends ActionBarActivity{
  
      @Override
      public void onCreate(Bundle savedInstanceState) {
  
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
          if (getSupportActionBar() != null) {
              getSupportActionBar().setElevation(0);
          }
  
          MaterialTabHost tabHost = (MaterialTabHost) findViewById(android.R.id.tabhost);
          tabHost.setType(MaterialTabHost.Type.FullScreenWidth);
  
          tabHost.addTab("one page");
          tabHost.addTab("two page");
  
          final ViewPager viewPager = (ViewPager) findViewById(R.id.pager);
          viewPager.setOnPageChangeListener(tabHost);
  
          tabHost.setOnTabChangeListener(new MaterialTabHost.OnTabChangeListener() {
              @Override
              public void onTabSelected(int position) {
                  viewPager.setCurrentItem(position);
              }
          });
      }
  
      @Override
      public boolean onCreateOptionsMenu(Menu menu) {
          // Inflate the menu; this adds items to the action bar if it is present.
          getMenuInflater().inflate(R.menu.menu_main, menu);
          return super.onCreateOptionsMenu(menu);
      }
  
      @Override
      public boolean onOptionsItemSelected(MenuItem item) {
          switch (item.getItemId()) {
              case R.id.name:
                  //in here call  public void setItem, set the textView Text.
                  break;
          }
          return super.onOptionsItemSelected(item);
      }
  
      public static class PlaceholderFragment extends Fragment{
          private static final String ARG_SECTION_NUMBER = "section_number";
          TextView textView;
  
          public static PlaceholderFragment newInstance(int sectionNumber) {
              PlaceholderFragment fragment = new PlaceholderFragment();
              Bundle args = new Bundle();
              args.putInt(ARG_SECTION_NUMBER, sectionNumber);
              fragment.setArguments(args);
              return fragment;
          }
  
          @Override
          public View onCreateView(LayoutInflater inflater, ViewGroup container,
                                   Bundle savedInstanceState) {
              View rootView = inflater.inflate(R.layout.ge_layout, container, false);
  
              textView = (TextView) rootView.findViewById(R.id.textView);
              return rootView;
          }
  
          public void setItem() {
              textView.setText("Test");
          }
      }
  }
  </code></pre>