Skip to content

Instantly share code, notes, and snippets.

@vuhung3990
Created August 19, 2014 09:10
Show Gist options
  • Save vuhung3990/f770950b0e3045d763b9 to your computer and use it in GitHub Desktop.
Save vuhung3990/f770950b0e3045d763b9 to your computer and use it in GitHub Desktop.
AndroidManifest.xml <activity......... android:configChanges="orientation|screenSize" /> </activity>
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) {
// todo
}else if(getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT){
// todo
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment