When configuration of the activity changes I apply this code -
public void onConfigurationChanged(Configuration newConfig)
{
super.onConfigurationChanged(newConfig);
gridView.setNumColumns(newConfig.orientation==Configuration.ORIENTATION_LANDSCAPE ? 3:2);
gridView.computeScroll();
}
I want that if the GridView
is in the midway, it will start from there only but as the configuration changes it is starting all over again from the top.
Add one line to your manifest file
No need to override onConfigChanges() method