title: How to make a view in Landscape mode in Portraint mode activity in android?
body: <p>I have layout which support only portrait mode. In layout there is three tab and onclick of tab, layout will changes. Now, on of the tab has Landscape mode. So when i click on Custom tab, it will move into Landscape mode. I have tried setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); but it will convert the whole layout instead of Linearlayout for Custom tab. I have created the Fragment for the Custom tab. But did not make the fragment in Landscape mode. Can you please help me?</p>
  <p>Bottom Tab Menu</p>
  <pre><code>&lt;!--Bottom Navigation--&gt;
      &lt;androidx.constraintlayout.widget.ConstraintLayout
  
          android:id=&quot;@+id/cnbottm&quot;
          android:layout_width=&quot;0dp&quot;
          android:layout_height=&quot;wrap_content&quot;
          android:background=&quot;@drawable/ic_main_chat_background&quot;
          android:clickable=&quot;false&quot;
          android:visibility=&quot;visible&quot;
          app:layout_constraintBottom_toBottomOf=&quot;parent&quot;
          app:layout_constraintEnd_toEndOf=&quot;parent&quot;
          app:layout_constraintStart_toStartOf=&quot;parent&quot;&gt;
  
          &lt;TextView
              android:id=&quot;@+id/tv_quick_setup&quot;
              android:layout_width=&quot;wrap_content&quot;
              android:layout_height=&quot;wrap_content&quot;
              android:background=&quot;?attr/selectableItemBackground&quot;
              android:clickable=&quot;true&quot;
              android:focusable=&quot;true&quot;
              android:fontFamily=&quot;@font/avenirnext_regular&quot;
              android:padding=&quot;@dimen/_10jdp&quot;
              android:text=&quot;Quick Set-up&quot;
              android:textColor=&quot;@color/whiteclour&quot;
              android:textSize=&quot;@dimen/_14jdp&quot;
              app:layout_constraintBottom_toBottomOf=&quot;parent&quot;
              app:layout_constraintEnd_toStartOf=&quot;@+id/tv_quick_custom&quot;
              app:layout_constraintHorizontal_bias=&quot;0.5&quot;
              app:layout_constraintHorizontal_chainStyle=&quot;spread&quot;
              app:layout_constraintStart_toEndOf=&quot;@+id/tv_random&quot;
              app:layout_constraintTop_toTopOf=&quot;parent&quot; /&gt;
  
          &lt;TextView
              android:id=&quot;@+id/tv_random&quot;
              android:layout_width=&quot;wrap_content&quot;
              android:layout_height=&quot;wrap_content&quot;
              android:background=&quot;?attr/selectableItemBackground&quot;
              android:fontFamily=&quot;@font/avenirnext_regular&quot;
              android:padding=&quot;@dimen/_10jdp&quot;
              android:text=&quot;Random&quot;
              android:textColor=&quot;@color/colorAccent&quot;
              android:textSize=&quot;@dimen/_14jdp&quot;
              app:layout_constraintBottom_toBottomOf=&quot;parent&quot;
              app:layout_constraintEnd_toStartOf=&quot;@+id/tv_quick_setup&quot;
              app:layout_constraintHorizontal_bias=&quot;0.5&quot;
              app:layout_constraintHorizontal_chainStyle=&quot;spread&quot;
              app:layout_constraintStart_toStartOf=&quot;parent&quot;
              app:layout_constraintTop_toTopOf=&quot;parent&quot; /&gt;
  
          &lt;View
              android:id=&quot;@+id/view_random&quot;
              android:layout_width=&quot;0dp&quot;
              android:layout_height=&quot;1dp&quot;
              android:layout_marginEnd=&quot;@dimen/_8jdp&quot;
              android:background=&quot;@color/colorAccent&quot;
              app:layout_constraintBottom_toTopOf=&quot;@+id/tv_random&quot;
              app:layout_constraintEnd_toStartOf=&quot;@+id/tv_quick_setup&quot;
              app:layout_constraintHorizontal_bias=&quot;0.5&quot;
              app:layout_constraintHorizontal_chainStyle=&quot;spread&quot;
              app:layout_constraintStart_toStartOf=&quot;parent&quot; /&gt;
  
          &lt;View
              android:id=&quot;@+id/view_quicksetup&quot;
              android:layout_width=&quot;0dp&quot;
              android:layout_height=&quot;1dp&quot;
              android:layout_marginStart=&quot;@dimen/_10jdp&quot;
              android:layout_marginEnd=&quot;@dimen/_10jdp&quot;
              android:background=&quot;@color/colorAccent&quot;
              android:visibility=&quot;gone&quot;
              app:layout_constraintBottom_toTopOf=&quot;@+id/tv_quick_setup&quot;
              app:layout_constraintEnd_toStartOf=&quot;@+id/tv_quick_custom&quot;
              app:layout_constraintHorizontal_bias=&quot;0.5&quot;
              app:layout_constraintHorizontal_chainStyle=&quot;spread&quot;
              app:layout_constraintStart_toEndOf=&quot;@+id/tv_random&quot; /&gt;
  
          &lt;View
              android:id=&quot;@+id/view_custom&quot;
              android:layout_width=&quot;0dp&quot;
              android:layout_height=&quot;1dp&quot;
              android:layout_marginStart=&quot;@dimen/_8jdp&quot;
              android:background=&quot;@color/colorAccent&quot;
              android:visibility=&quot;gone&quot;
              app:layout_constraintBottom_toTopOf=&quot;@+id/tv_quick_custom&quot;
              app:layout_constraintEnd_toEndOf=&quot;parent&quot;
              app:layout_constraintHorizontal_bias=&quot;0.5&quot;
              app:layout_constraintHorizontal_chainStyle=&quot;spread&quot;
              app:layout_constraintStart_toEndOf=&quot;@+id/tv_quick_setup&quot; /&gt;
  
          &lt;TextView
              android:id=&quot;@+id/tv_quick_custom&quot;
              android:layout_width=&quot;wrap_content&quot;
              android:layout_height=&quot;wrap_content&quot;
              android:background=&quot;?attr/selectableItemBackground&quot;
              android:clickable=&quot;true&quot;
              android:focusable=&quot;true&quot;
              android:fontFamily=&quot;@font/avenirnext_regular&quot;
              android:padding=&quot;@dimen/_10jdp&quot;
              android:text=&quot;Custom&quot;
              android:textColor=&quot;@color/whiteclour&quot;
              android:textSize=&quot;@dimen/_14jdp&quot;
              app:layout_constraintBottom_toBottomOf=&quot;parent&quot;
              app:layout_constraintEnd_toEndOf=&quot;parent&quot;
              app:layout_constraintHorizontal_bias=&quot;0.5&quot;
              app:layout_constraintHorizontal_chainStyle=&quot;spread&quot;
              app:layout_constraintStart_toEndOf=&quot;@+id/tv_quick_setup&quot;
              app:layout_constraintTop_toTopOf=&quot;parent&quot; /&gt;
  
      &lt;/androidx.constraintlayout.widget.ConstraintLayout&gt;
  
  
  each tab onclick, it will visible/gone
  for other two tabs
  
       &lt;LinearLayout
              android:id=&quot;@+id/liner_bottom&quot;
              android:layout_width=&quot;match_parent&quot;
              android:layout_height=&quot;wrap_content&quot;
              android:background=&quot;@drawable/ic_main_chat_background&quot;
              android:clickable=&quot;true&quot;
              android:elevation=&quot;6dp&quot;
              android:focusable=&quot;true&quot;
              android:orientation=&quot;vertical&quot;
              android:visibility=&quot;visible&quot;
              app:layout_constraintBottom_toTopOf=&quot;@+id/cnbottm&quot;&gt;
      &lt;/LinearLayout&gt;
  
      for custom Tab
      
      &lt;RelativeLayout
              android:id=&quot;@+id/liner_bottom_custom&quot;
              android:layout_width=&quot;match_parent&quot;
              android:layout_height=&quot;match_parent&quot;
              android:orientation=&quot;horizontal&quot;
              android:background=&quot;@color/colorPrimary&quot;
              android:clickable=&quot;true&quot;
              android:focusable=&quot;true&quot;
              android:visibility=&quot;gone&quot;
              app:layout_constraintBottom_toTopOf=&quot;@+id/cnbottm&quot;&gt;
      
              &lt;include layout=&quot;@layout/actvty_chart_custom_tab&quot;
                  /&gt;
      
          &lt;/RelativeLayout&gt;
  </code></pre>