title: getTag() always returns null when called in fragment
body: <p>I have a problem, because getTag() method returns me null when I call it in fragment which is a part of a ViewPager Tab Layout I created.</p>
  <h3>Code</h3>
  <pre><code>import java.util.ArrayList;
  
  import android.os.Bundle;
  import android.support.v4.app.Fragment;
  import android.support.v4.app.FragmentTransaction;
  import android.view.LayoutInflater;
  import android.view.View;
  import android.view.ViewGroup;
  import android.widget.ListView;
  import android.widget.Toast;
  
  public class HistoryFragment extends Fragment {
      ListView listView;
      HistoryAdapter adapter;
      
      @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
          View history = inflater.inflate(R.layout.fragment_history, container, false);
          ArrayList&lt;ToSave&gt; arrayOfData = new ArrayList&lt;ToSave&gt;();
          adapter = new HistoryAdapter(getActivity().getBaseContext(), arrayOfData);
          listView = (ListView) history.findViewById (R.id.listView1);
          listView.setAdapter(adapter);
          String myTag = getTag();
          ((MainActivity)getActivity()).setHistoryFragment(myTag);
          Toast.makeText(getActivity(), &quot;HistoryFragment.onCreateView(): &quot; + myTag, Toast.LENGTH_LONG).show();
          return history;
      }
  }
  </code></pre>
  <p>I want to use it for communication between Fragments (add ListView items by clicking a button in another fragment), but I can't make it work.</p>
  <h3>edit</h3>
  <h3>TabPagerAdapter.java</h3>
  <pre><code>      @Override
        public Fragment getItem(int i) {
          switch (i) {
              case 0:
                  if (mFragmentAtPos0 ==null) {
                      mFragmentAtPos0 = new PartyFragment(listener);
                  }
                  return mFragmentAtPos0;
              case 1:
                  return new SummaryFragment();
              case 2:
                  return new HistoryFragment();
              }
          return null;
        }
  </code></pre>