title: android fragment getArguments returns null in oncreateView()
body: <p>I have two fragments and <code>FilterFragment</code> and <code>LocationListFragment</code>. when I am switching to <code>LocationListFragment.java</code> I am getting values in <code>getArguments()</code> and from <code>LocationListFragment.java</code> to <code>FilterFragment.java</code> getting null values by calling <code>getArgument()</code>; here is the details</p>
  
  <p>In <code>FilterFargment.java</code> code is here for set values:</p>
  
  <pre><code>  LocationListFragment locationListFragment = new LocationListFragment();
               bundle = new Bundle();
              Log.e("",""+locationList.getLocationListFilter().size());
              bundle.putParcelable(Constant.LOCATION_LIST_FILTER, locationList);
              bundle.putString(Constant.FROM_DATE_FILTER, textView_time_from.getText().toString());
              locationListFragment.setArguments(bundle);
              ((DashbordActivity) getActivity()).switchFragment(locationListFragment, true);
  </code></pre>
  
  <p>In <code>LocationListFragment.java</code> (getting values)</p>
  
  <pre><code> @Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      Bundle args = getArguments();
      if (args != null) {
          locationList = args.getParcelable(Constant.LOCATION_LIST_FILTER);
          getFromDate = args.getString(Constant.FROM_DATE_FILTER);}}
  </code></pre>
  
  <p>And here from <code>LocationListFragment</code> on button click send data to <code>FilterFragment</code> sending new values with bundle:</p>
  
  <pre><code>FilterFragment filterFragment =new FilterFragment();//.newInstance(getFromDate, getEndDate, getLocation, getCategories);
      Bundle bundle = new Bundle();
      bundle.putString(Constant.FROM_DATE_FILTER, getFromDate);
      bundle.putString(Constant.WHERE_FILTER, getLocation);
      filterFragment.setArguments(bundle);
      ((DashbordActivity) getActivity()).switchFragment(filterFragment, true);
  </code></pre>
  
  <p>and in <code>FilterFragment.java</code> while returning back getting <strong>null</strong> value for <code>getArguments();</code> code is here:</p>
  
  <pre><code>@Override
  public View onCreateView(LayoutInflater inflater, ViewGroup container,
                           Bundle savedInstanceState) {
      // Inflate the layout for this fragment
      View v = inflater.inflate(R.layout.fragment_filter, container, false);
      Log.e("FilterFragment", "oncreateview");
  
      Bundle args = getArguments();
      Log.e("getArguments", "" + getArguments());//getting null here
  </code></pre>
  
  <p>Also, I have used this method for switching fragment,</p>
  
  <pre><code>    public void switchFragment(BaseFragment fragment, boolean keep) {
      FragmentManager manager = getSupportFragmentManager();
  
      boolean fragmentPopped = manager.popBackStackImmediate(fragment.getClass().getSimpleName(), 0);
  
      if (!fragmentPopped &amp;&amp; manager.findFragmentByTag(fragment.getClass().getSimpleName()) == null) { //fragment not in back stack, create it.
  
          FragmentTransaction tr = manager.beginTransaction();
  
          tr.replace(R.id.container, fragment, fragment.getClass().getSimpleName());
  
          if (keep) {
              tr.addToBackStack(fragment.getClass().getSimpleName());
         Log.e("keep", "BaseAct:" + keep);
          }
          tr.commit();
      }
  }
  </code></pre>
  
  <p>Can you tell me what I am missing? Any help will be appreciated.</p>