4

My question is how to landscape Activity or TableLayout in the TabHost Layout?

I mean How to do something like this?

enter image description here

My Situation is the same this question Android: Landscape Child Activity in a Portrait Tab Activity

Thanks,,,

Community
  • 1
  • 1
thalsharif
  • 357
  • 2
  • 6
  • 18

1 Answers1

2

As per my knowledge, all the layouts can automatically converts themselves in changed orientation mode. Please use below code to handle orientation mode.

Apply below code in menifest files for each activity for each tab.

android:configChanges="orientation|keyboardHidden"

Then apply below code to each code of each activity.

public void onConfigurationChanged(Configuration newConfig) {
        super.onConfigurationChanged(newConfig);
        if(newConfig.orientation==Configuration.ORIENTATION_LANDSCAPE)
            //Toast.makeText(getApplicationContext(), "no", Toast.LENGTH_SHORT).show();
        {

        }
        else

        {

        }

}
Maneesh
  • 6,098
  • 5
  • 36
  • 55
  • Good, I tries your code, but nothing happen. for more explaining my situation is the same this question http://stackoverflow.com/questions/6615548/android-landscape-child-activity-in-a-portrait-tab-activity – thalsharif Oct 25 '11 at 07:35
  • I don't understand, for which you want to lock the orientation ,desired activity shown in tabs or tab only..I mean 1. Do u want to stop the orientation of tabs or 2. Do you want to stop the orientation of screen in tab??? – Maneesh Oct 25 '11 at 07:54
  • I want to lock the orientation of tabs and screen and everything, but the taps always be on portrait state and the activities inside tabs always be on landscape state. – thalsharif Oct 25 '11 at 08:43
  • I tried the same, and I found that tab and tab content can't have different orientation at the same time. As far as I think its not possible – Maneesh Oct 25 '11 at 09:32
  • Hope this will help http://stackoverflow.com/questions/1258275/vertical-rotated-label-in-android – Maneesh Oct 25 '11 at 09:35