0

I'm using the StaggeredGridView to load image and data via webservice. In portrait mode i have 2 grids, in landscape mode i have 3 grids. I want to save the instance when i change the screen orientation to avoid the synctask from re-execute. I used:

@Override
public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);
    setRetainInstance(true);
}

but the problem is, in landscape mode i have 2 grids not 3. So what is the correct way to get 3 grids?

1 Answers1

1
 app:column_count_landscape="3"
 app:column_count_portrait="2"

add these lines in xml

android:configChanges="orientation|screenSize"

add this in manifest.xml

Mustafa ASAN
  • 3,747
  • 2
  • 23
  • 34