android4.0强制横屏竖屏

方法:

android4.0/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java

 int computeForcedAppOrientationLocked() {

       int req = getOrientationFromWindowsLocked();

        if (req == ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED) {

            req = getOrientationFromAppTokensLocked();

        }

        // req = ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE; //强制横屏0度

    // req = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT; //强制竖屏左转90度

        return req;

    }

参考:http://blog.chinaunix.net/uid-22956619-id-3261121.html

你可能感兴趣的:(android4.0强制横屏竖屏)