2016年7月27日 星期三

Recyclerview after rotate,the iteam sort has problem

solved

1. use the new version
compile 'com.android.support:recyclerview-v7:24.0.0'
compile 'com.android.support:cardview-v7:24.0.0'


2.

after swap the data,create a new layout manager

myrecycleViewadapter.swapCursor(data); 
        } 

        if (mainActivity.getIsTwoPlanMode() && !isPortrait()) { 
            mLayoutManager = new StaggeredGridLayoutManager(3, StaggeredGridLayoutManager.VERTICAL); 
        } else { 
            mLayoutManager = new StaggeredGridLayoutManager(2, StaggeredGridLayoutManager.VERTICAL); 
        } 

        myRecyclerView.setLayoutManager(mLayoutManager);