title: Android Screen Orientation: Portrait doesn't work
body: <p>I want my Activity to run only in portrait mode, so i tried different things, but none of them worked... here they are:</p>
  
  <p>manifest:</p>
  
  <pre><code>&lt;application
          android:name=".App"
          android:allowBackup="true"
          android:icon="@drawable/ic_launcher"
          android:label="@string/app_name"
          android:theme="@style/AppTheme"&gt;
          &lt;activity
              android:name=".MainActivity"
              android:screenOrientation="portrait"
              android:configChanges="keyboardHidden|orientation"
              android:theme="@style/AppTheme.NoActionBar"&gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="android.intent.action.MAIN" /&gt;
  
                  &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
              &lt;/intent-filter&gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="intent.to.front" /&gt;
  
                  &lt;category android:name="android.intent.category.DEFAULT" /&gt;
              &lt;/intent-filter&gt;
          &lt;/activity&gt;
  </code></pre>
  
  <p>Didn't work, still could rotate, even if my phone had screen rotation turned off.</p>
  
  <p>next I tried from code. removed added staff from manifest, and wrote this in mainactivity class:</p>
  
  <pre><code>@Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
          Utilities.setLocale(getApplicationContext());
          setContentView(R.layout.activity_main);
  </code></pre>
  
  <p>here's my layout</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      xmlns:tools="http://schemas.android.com/tools" android:id="@+id/drawer_layout"
      android:layout_width="match_parent" android:layout_height="match_parent"
      android:fitsSystemWindows="true" tools:openDrawer="start"&gt;
  
      &lt;include layout="@layout/app_bar_main" android:layout_width="match_parent"
          android:layout_height="match_parent" /&gt;
  
      &lt;android.support.design.widget.NavigationView android:id="@+id/nav_view"
          android:layout_width="wrap_content" android:layout_height="match_parent"
          app:itemIconTint="@color/grey"
          android:layout_gravity="start" android:fitsSystemWindows="true"
          app:headerLayout="@layout/nav_header_main" app:menu="@menu/activity_main_drawer" /&gt;
  
  &lt;/android.support.v4.widget.DrawerLayout&gt;
  </code></pre>
  
  <p>result was: It doesn't let me rotate, but when I do, whole app freezes and can't do anything until I rotate it back to portrate.</p>
  
  <p>Help me guys!</p>