获得当前activity的屏幕方向

WindowManager mgr = ((WindowManager) getContext().getSystemService(Context.WINDOW_SERVICE));

int lastOrientation = mgr.getDefaultDisplay().getRotation();

activity.setRequestedOrientation(lastOrientation);

posted @ 2014-08-20 14:34  安谧世界  阅读(1003)  评论(0编辑  收藏  举报