Created
July 21, 2017 00:06
-
-
Save keinix/b1a6af47e46cdcfed4524888b5de39be to your computer and use it in GitHub Desktop.
Turn the entire android app to portrait only.
This file contains 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
package com.keinix.interactivestory; | |
import android.app.Activity; | |
import android.app.Application; | |
import android.content.pm.ActivityInfo; | |
import android.os.Bundle; | |
public class InteractiveStoryApplication extends Application { | |
@Override | |
public void onCreate() { | |
super.onCreate(); | |
registerActivityLifecycleCallbacks(new ActivityLifecycleCallbacks() { | |
@Override | |
public void onActivityCreated(Activity activity, Bundle bundle) { | |
activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); | |
} | |
@Override | |
public void onActivityStarted(Activity activity) { | |
} | |
@Override | |
public void onActivityResumed(Activity activity) { | |
} | |
@Override | |
public void onActivityPaused(Activity activity) { | |
} | |
@Override | |
public void onActivityStopped(Activity activity) { | |
} | |
@Override | |
public void onActivitySaveInstanceState(Activity activity, Bundle bundle) { | |
} | |
@Override | |
public void onActivityDestroyed(Activity activity) { | |
} | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment