Last active
August 29, 2015 14:11
-
-
Save omegasoft7/41881f9dabaf6eb7d340 to your computer and use it in GitHub Desktop.
Make orientation without destroy and reload activity
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//ON Activity | |
@Override | |
public void onConfigurationChanged(Configuration newConfig) { | |
super.onConfigurationChanged(newConfig); | |
if(newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE) { | |
//Landscape orientation | |
} else if(newConfig.orientation == Configuration.ORIENTATION_PORTRAIT) { | |
//Portrate orientation | |
} | |
} | |
//ON AndroidManifest.xml | |
<activity | |
android:name="com.example.myActivity" | |
android:label="" | |
android:configChanges="orientation|screenSize"/> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment