我给activity加上了 
android:screenOrientation="portrait"  这个设置
确实也阻止了横竖屏切换这个事件的发生,但是activity还是destroyed并且重新onCreate了
这是为什么呢
根据下面API的解释,至少在看上去,设置并没有被修改啊?If the configuration of the device (as defined by the Resources.Configuration class) changes, then anything displaying a user interface will need to update to match that configuration. 
Unless you specify otherwise, a configuration change (such as a change in screen orientation, language, input devices, etc) will cause your current activity to be destroyed,是不是因为,虽然看上去没有变,但是UI的状态还是改变了,不过对应这个状态改变做出的动作,就是维持屏幕不变??

解决方案 »

  1.   

    public static final int configChanges
    Since: API Level 1Specify one or more configuration changes that the activity will handle itself. 还有 上面说,如果指定一种或多种configuration changes ,activity will handle itself. 为什么设置Activity的android:configChanges="orientation"后,横竖屏切换以后,还是会destroyed?
      

  2.   

    这个没有研究过,你可以重写一下 onConfigurationChange方法