{"id":6992,"date":"2014-05-16T01:20:07","date_gmt":"2014-05-16T01:20:07","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/05\/16\/how-can-i-get-the-current-screen-orientation-collection-of-common-programming-errors\/"},"modified":"2014-05-16T01:20:07","modified_gmt":"2014-05-16T01:20:07","slug":"how-can-i-get-the-current-screen-orientation-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/05\/16\/how-can-i-get-the-current-screen-orientation-collection-of-common-programming-errors\/","title":{"rendered":"How can I get the current screen orientation?-Collection of common programming errors"},"content":{"rendered":"<p>I just want to set some flags when my orientation is in landscape so that when the activity is recreated in onCreate() i can toggle between what to load in portrait vs. landscape. I already have a layout-land xml that is handling my layout.<\/p>\n<pre><code>public void onConfigurationChanged(Configuration _newConfig) {\n\n        if (_newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE) {\n            this.loadURLData = false;\n        }\n\n        if (_newConfig.orientation == Configuration.ORIENTATION_PORTRAIT) {\n            this.loadURLData = true;\n        }\n\n        super.onConfigurationChanged(_newConfig);\n    }\n<\/code><\/pre>\n<p>Over-riding onConfigurationChanged will prevent my layout-land xml from loading in landscape orientation.<\/p>\n<p>I just want to get the current orientation of my device in onCreate(). How can I get this?<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I just want to set some flags when my orientation is in landscape so that when the activity is recreated in onCreate() i can toggle between what to load in portrait vs. landscape. I already have a layout-land xml that is handling my layout. public void onConfigurationChanged(Configuration _newConfig) { if (_newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE) { this.loadURLData [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-6992","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/6992","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=6992"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/6992\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=6992"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=6992"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=6992"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}