android - Prevent GridView from scrolling on onConfigurationChanged -


when configuration of activity changes apply code -

public void onconfigurationchanged(configuration newconfig)     {         super.onconfigurationchanged(newconfig);         gridview.setnumcolumns(newconfig.orientation==configuration.orientation_landscape ? 3:2);         gridview.computescroll();     } 

i want if gridview in midway, start there configuration changes starting on again top.

add 1 line manifest file

no need override onconfigchanges() method

<activity             android:name="youractivity"             android:configchanges="keyboardhidden|orientation|screensize"  /> 

Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

IIS->Tomcat Redirect: multiple worker with default -