to top
Android APIs
 

backup_restore.xml

← Back

The file containing the source code shown below is located in the corresponding directory in <sdk>/samples/android-<version>/...

<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2010 The Android开源工程

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->

<!-- Layout description of the BackupRestore sample's main activity -->

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">

    <ScrollView
        android:orientation="vertical"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_weight="1">

        <LinearLayout
            android:orientation="vertical"
            android:layout_width="match_parent"
            android:layout_height="wrap_content">

            <TextView android:text="@string/filling_text"
                android:textSize="20dp"
                android:layout_marginTop="20dp"
                android:layout_marginBottom="10dp"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"/>

            <RadioGroup android:id="@+id/filling_group"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginLeft="20dp"
                android:orientation="vertical">

                <RadioButton android:id="@+id/bacon"
                    android:text="@string/bacon_label"/>
                <RadioButton android:id="@+id/pastrami"
                    android:text="@string/pastrami_label"/>
                <RadioButton android:id="@+id/hummus"
                    android:text="@string/hummus_label"/>

            </RadioGroup>

            <TextView android:text="@string/extras_text"
                android:textSize="20dp"
                android:layout_marginTop="20dp"
                android:layout_marginBottom="10dp"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"/>

            <CheckBox android:id="@+id/mayo"
                android:text="@string/mayo_text"
                android:layout_marginLeft="20dp"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"/>

            <CheckBox android:id="@+id/tomato"
                android:text="@string/tomato_text"
                android:layout_marginLeft="20dp"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"/>

        </LinearLayout>

    </ScrollView>

    <Button android:id="@+id/restore_button"
        android:text="@string/restore_text"
        android:onClick="onRestoreButtonClick"
        android:layout_height="wrap_content"
        android:layout_width="wrap_content"
        android:layout_weight="0" />

</LinearLayout>