staggeredgridlayoutmanager setspancount is not working in fragement
<p>i am trying to change the span count by passing a value from activity, the value is passing but the span is not changing , my code is like ,</p>

<pre><code>@Override
    public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstance){
        mStaggeredLayoutManager = new StaggeredGridLayoutManager(1, StaggeredGridLayoutManager.VERTICAL);
        View inflatedView = inflater.inflate(R.layout.start_fragment, container, false);
        mRecyclerView = (RecyclerView)inflatedView.findViewById(R.id.list);
        mRecyclerView.setLayoutManager(mStaggeredLayoutManager);
        mRecyclerView.setHasFixedSize(true); //Data size is fixed - improves performance
        mAdapter = new TravelListAdapter(getActivity());
        mRecyclerView.setAdapter(mAdapter);
        try{
            int span = getArguments().getInt("grid",0);
            mStaggeredLayoutManager.setSpanCount(span);
            Toast.makeText(getActivity(), String.valueOf(span), Toast.LENGTH_SHORT).show();
        }catch (Exception e){

        }

        return inflatedView;
    }
</code></pre>

<p>why is it not working? </p>