title: Android: detect screen orientation change also if orientation is lock
body: <p>I have an Android app with one Activity and a custom ViewPager with several fragments. My entire activity is locked in portrait, but now i need to detect, inside a specific fragment, when device is in landscape and launch another activity locked in landscape. In this new activity, when user put device in portrait, i would close it and return to portrait activity. 
  This is AndroidManifest.xml code:</p>
  
  <pre><code> &lt;activity
          android:name="com.mypackage.MainActivity"
          android:configChanges="orientation"
          android:label="@string/app_name"
          android:launchMode="singleTask"
          android:screenOrientation="portrait"
          android:theme="@style/Theme.AppCompat.Light" &gt;
      &lt;/activity&gt;
  </code></pre>
  
  <p>and this is code inside fragment that should detect landscape:</p>
  
  <pre><code>public void onConfigurationChanged(Configuration myConfig) {
      int orient = getResources().getConfiguration().orientation;
      switch (orient) {
      case Configuration.ORIENTATION_LANDSCAPE:
          //Launch new activity
          break;
      }       
  }
  </code></pre>
  
  <p>Now i've noticed that onConfigurationChanges is never called with this manifest configuration, but is called only if i remove </p>
  
  <pre><code>android:screenOrientation="portrait"
  </code></pre>
  
  <p>There's a way to keep MainActivity locked in portrait and intercept landscape too?</p>