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
Post a Comment