A
androidugs
Neues Mitglied
- 0
Hallo ich möchte folgenden AppAufbau. Eine Basis activity die immer läuft wo ich ein paar buttons drauf hab die auf der rechten seite immer sichtbar sind. Links davon sollen Tabs dargestellt werden, am besten für jeden Tab eine Activity wobei dies nicht zwingend notwendig ist. folgendermaßen sieht meine .xml datei aus:
Wie muss ich hierfür nun meine mainActivity aufbauen, welche von FragmentActivity erben soll?
Vielen Dank für eure Hilfe.
HTML:
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/tableLayout1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_gravity="top|left"
android:orientation="vertical"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:screenOrientation="landscape"
tools:context=".MainActivity" >
<TableRow>
<android.support.v4.app.FragmentTabHost
android:id="@android:id/tabhost"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<TabWidget
android:id="@android:id/tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0"
android:orientation="horizontal" />
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_weight="0" />
<FrameLayout
android:id="@+id/realtabcontent"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1" />
</LinearLayout>
</android.support.v4.app.FragmentTabHost>
<RelativeLayout>
<Button
android:id="@+id/continue_button"
android:layout_width="150dp"
android:layout_height="150dp"
android:layout_alignParentLeft="true"
android:layout_marginTop="27dp"
android:text="@string/continue" />
<Button
android:id="@+id/stop_button"
android:layout_width="150dp"
android:layout_height="150dp"
android:layout_alignBaseline="@+id/continue_button"
android:layout_alignBottom="@+id/continue_button"
android:layout_alignParentRight="true"
android:onClick="Stop"
android:text="@string/stop" />
</RelativeLayout>
</TableRow>
</TableLayout>
PHP:
public class MainActivity extends FragmentActivity implements IUpdateable, OnSeekBarChangeListener {
private static final String TAG = MainActivity.class.getSimpleName();
@Override
protected void onCreate(Bundle savedInstanceState) {
final FragmentTabHost mTabHost;
super.onCreate(savedInstanceState);
//was kommt hier hin? ... sprich wie erstelle ich die tabs und zeige sie an?