package com.examples.universal;
import android.app.Activity;
import android.os.Bundle;
public class UniversalActivity extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}
}
//main.xml
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="This is a vertical layout for PORTRAIT"
/>
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button One"
/>
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button Two"
/>
//layout-land/main.xml
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="The is a horizontal layout for LANDSCAPE"
/>
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button One"
/>
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button Two"
/>
//layout-large/main.xml
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="This is the layout for TABLETS"
/>
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button One"
/>
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button Two"
/>
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button Three"
/>
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button Four"
/>