5/16/2013

orientation event fix - android


Reacting to Configuration Changes

Start be adding the android:configChanges node to your Activity's manifest node

android:configChanges="keyboardHidden|orientation"

setContentView to force the GUI layout to be re-done in the new orientation.


@Override
public void onConfigurationChanged(Configuration newConfig) {
  super.onConfigurationChanged(newConfig);
  setContentView(R.layout.myLayout);
}

댓글 없음: