---
title: "android 从横屏到竖屏状态出现黑屏"
author: "ericchan2012"
date: "2012-10-16T12:08:09Z"
tags: []
categories: ["移动开发"]
slug: "android"
draft: false
lastmod: "2012-10-16T12:08:09Z"
id: 1699126
url: "https://ericchan2012.iteye.com/blog/1699126"
---

修改WindowManagerService.java中的performLayoutLockedInner()
在if (!win.mLayoutAttached) 
后面添加
代码如下：
 if (win.mIsWallpaper)
            {
                gone = win.mViewVisibility == View.GONE
                        || !win.mRelayoutCalled
                        || (atoken != null && atoken.hiddenRequested)
                        || win.mAttachedHidden
                        || win.mExiting || win.mDestroying;
            }