title: ViewPager is not refresh automaticly
body: <p>I would like to change text other fragment in tabs when user input edittext and enter this</p>
  
  <p>and I have some problem about viewpager , it's not refresh automaticly when user enter, but if user swipe tab refresh it's work!</p>
  
  <p>example :</p>
  
  <p>current in tab1 when user enter ,tab1 is not refresh but user swipe to tab2 ,tab2 is refresh and user swipe to tab1 ,tab1 is refresh!</p>
  
  <p>I want to viewpager is refresh automaticaly</p>
  
  <p>thanks for your help and sorry my english is not good.</p>
  
  <p>my activity</p>
  
  <pre><code>public class SearchActivity extends AppCompatActivity {
  
      public static EditText edt_home_titlebar;
      ImageView btn_home_slidemenu;
      public static String query_text=null;
      ViewPager pager;
      SmartTabLayout tabs;
      private ArrayList&lt;PagerItem&gt; mTabs = new ArrayList&lt;PagerItem&gt;();
      MyPagerAdapter myPager;
  
      @Override
      protected void onDestroy() {
          super.onDestroy();
          query_text=null;
      }
  
      @Override
      public void onCreate( Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.search_activity);
  
          edt_home_titlebar = (EditText) findViewById(R.id.edt_home_titlebar);
          btn_home_slidemenu = (ImageView) findViewById(R.id.btn_home_slidemenu);
  
  
          initTabs();
          pager = (ViewPager) findViewById(R.id.pager);
          tabs = (SmartTabLayout) findViewById(R.id.tabs);
  
          pager.setAdapter(new MyPagerAdapter(getSupportFragmentManager()));
          tabs.setDistributeEvenly(true);
          tabs.setViewPager(pager);
          Log.d("SearchActivity", "onCreate: " + query_text);
  
          edt_home_titlebar.setOnEditorActionListener(new TextView.OnEditorActionListener() {
              @Override
              public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
                  if (actionId == EditorInfo.IME_ACTION_SEARCH) {
  
                      query_text = edt_home_titlebar.getText().toString().trim();
                      Log.d("SearchActivity", "onEditorAction4: " + query_text);
  
                      return true;
                  }
                  return false;
              }
          });
          btn_home_slidemenu.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                  onBackPressed();
              }
          });
  
      }
  
      class MyPagerAdapter extends FragmentStatePagerAdapter {
  
          public MyPagerAdapter(FragmentManager fm) {
              super(fm);
          }
  
          @Override
          public Fragment getItem(int position) {
              return mTabs.get(position).createFragment(position);
          }
  
          @Override
          public int getCount() {
              return mTabs.size();
          }
  
          @Override
          public CharSequence getPageTitle(int position) {
              Log.d("SearchActivity","mTabs=&gt;"+mTabs.get(position).getTitle().toString());
              return mTabs.get(position).getTitle().toString();
          }
  
          @Override
          public int getItemPosition(Object object) {
              return PagerAdapter.POSITION_NONE;
          }
      }
      class PagerItem {
          private final CharSequence mTitle;
  
          PagerItem(CharSequence title) {
              mTitle = title;
  
          }
  
          Fragment createFragment(int i) {
              Log.d("SearchActivity","getI=&gt;"+i);
  //            Fragment fragment = null;
              switch (i) {
                  case 0:
                      SearchSlideFragment fragment1 = new SearchSlideFragment();
                      Log.d("SearchActivity","(FRIEND)title=&gt;"+mTabs.get(0).getTitle().toString());
                      return fragment1;
                  case 1:
                      SearchPage fragment2 =new SearchPage();
                      Log.d("SearchActivity","get(1)title=&gt;"+mTabs.get(1).getTitle().toString());
                      return fragment2;
                  case 2:
                      SearchDiaryFragment fragment3 = new SearchDiaryFragment();
                      Log.d("SearchActivity","(DIARY)title=&gt;"+mTabs.get(2).getTitle().toString());
                      return fragment3;
                  case 3:
                      SearchQuestFragment fragment4 = new SearchQuestFragment();
                      Log.d("SearchActivity","(QUEST)title=&gt;"+mTabs.get(3).getTitle().toString());
                      return fragment4;
                  case 4:
                      Log.d("SearchActivity","get(4)title=&gt;"+mTabs.get(4).getTitle().toString());
                      SearchReviewFragment fragment5 = new SearchReviewFragment();
                      return fragment5;
                  case 5:
                      SearchTopicFragment fragment6 = new SearchTopicFragment();
                      Log.d("SearchActivity","(TOPIC)title=&gt;"+mTabs.get(5).getTitle().toString());
                      return fragment6;
                  default:
                      return null;
              }
  
          }
  
          CharSequence getTitle() {
              return mTitle;
          }
      }
      private void initTabs(){
          mTabs.clear();
          mTabs.add(new PagerItem(this.getResources().getString(R.string.tx_people)));
          mTabs.add(new PagerItem(this.getResources().getString(R.string.tx_slide_page)));
          mTabs.add(new PagerItem(this.getResources().getString(R.string.tx_diary)));
          mTabs.add(new PagerItem(this.getResources().getString(R.string.tx_quest)));
          mTabs.add(new PagerItem(this.getResources().getString(R.string.tx_review)));
          mTabs.add(new PagerItem(this.getResources().getString(R.string.tx_topic)));
      }
  }
  </code></pre>