我在setContentView时崩溃

时间:2011-07-11 04:32:31

标签: android android-layout

以下XML在运行时崩溃。我找不到拯救生命的问题。

<?xml version="1.0" encoding="utf-8"?>
<ScrollView
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/Scroll"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" >
<LinearLayout
  xmlns:android="http://schemas.android.com/apk/res/android"
  android:orientation="vertical"
  android:layout_width="fill_parent"
  android:layout_height="wrap_content">
    <TableLayout 
        android:layout_height="wrap_content" 
        android:id="@+id/tableLayout3" 
        android:layout_width="match_parent">
        <TableRow 
            android:layout_height="wrap_content" 
            android:id="@+id/tableRow8"
             android:layout_width="match_parent">
            <TextView 
                android:textAppearance="?android:attr/textAppearanceSmall" 
                android:gravity="center_vertical|center_horizontal" 
                android:id="@+id/textView1" 
                android:layout_weight="1" 
                android:layout_height="wrap_content" 
                android:text="Fish Details">
            </TextView>
        </TableRow>
        <TableRow 
            android:layout_height="wrap_content"
             android:id="@+id/tableRow9" 
             android:layout_width="match_parent">
            <TextView
                android:textAppearance="?android:attr/textAppearanceLarge" 
                android:padding="10dp"
                android:id="@+id/TextView01" 
                android:layout_height="wrap_content" 
                android:text="Specie" 
                android:layout_width="wrap_content"
                android:gravity="center_vertical|right">
            </TextView>
            <Spinner 
                android:layout_weight="1" 
                android:id="@+id/specieSpinner" 
                android:layout_height="wrap_content" 
                android:layout_width="match_parent" 
                android:padding="10dp">
            </Spinner>
        </TableRow>
        <TableRow 
            android:id="@+id/tableRow5" 
            android:layout_width="wrap_content" 
            android:layout_height="wrap_content">
            <TextView 
                android:textAppearance="?android:attr/textAppearanceLarge"
                android:padding="10dp"
                android:gravity="right|center_vertical"
                android:layout_weight="0" 
                android:id="@+id/TextView06"
                android:layout_height="wrap_content"
                android:text="Bait">
            </TextView>
            <Spinner
                android:id="@+id/baitSpinner" 
                android:layout_height="wrap_content" 
                android:gravity="center_vertical|center_horizontal" 
                android:layout_weight="1">
            </Spinner>
        </TableRow>
        <!-- <TableRow 
            android:id="@+id/tableRow3" 
            android:layout_width="wrap_content" 
            android:layout_height="wrap_content">
            <TextView 
                android:padding="10dp" 
                android:gravity="right|center_vertical" 
                android:textAppearance="?android:attr/textAppearanceLarge" 
                android:layout_weight="0" 
                android:id="@+id/textView4"
                android:layout_height="wrap_content" 
                android:text="Inches">
            </TextView>
            <LinearLayout 
                android:id="@+id/linearLayout1" 
                android:layout_weight="1" 
                android:layout_height="wrap_content" 
                android:weightSum="1">
                <Button 
                    android:text="-" 
                    android:layout_height="wrap_content"
                    android:id="@+id/lengthMinus" 
                    android:layout_weight=".20">
                </Button>
                <EditText 
                    android:id="@+id/length" 
                    android:layout_height="wrap_content" 
                    android:inputType="number" 
                    android:layout_weight="0.60">
                </EditText>
                <Button 
                    android:text="+" 
                    android:layout_height="wrap_content" 
                    android:id="@+id/lengthPlus" 
                    android:layout_weight=".20">
                </Button>
            </LinearLayout>
        </TableRow>
        <TableRow 
            android:id="@+id/tableRow2"
            android:layout_width="wrap_content" 
            android:layout_height="wrap_content">
            <TextView 
                android:padding="10dp"
                android:gravity="right|center_vertical" 
                android:textAppearance="?android:attr/textAppearanceLarge" 
                android:layout_weight="0" 
                android:id="@+id/textView5"
                android:layout_height="wrap_content" 
                android:text="Lbs">
            </TextView>
            <LinearLayout
                android:id="@+id/linearLayout2" 
                android:layout_weight="1" 
                android:layout_height="wrap_content">
                <Button 
                    android:text="-"
                    android:id="@+id/lbsMinus" 
                    android:layout_weight=".20" 
                    android:layout_height="wrap_content">
                </Button>
                <EditText 
                    android:id="@+id/lbs" 
                    android:layout_height="wrap_content" 
                    android:layout_weight=".60"
                     android:inputType="number">
                </EditText>
                <Button 
                    android:text="+" 
                    android:id="@+id/lbsPlus" 
                    android:layout_weight=".20" 
                    android:layout_height="wrap_content">
                </Button>
            </LinearLayout>         
        </TableRow>-->
        <TableRow 
            android:id="@+id/tableRow1" 
            android:layout_width="wrap_content" 
            android:layout_height="wrap_content">
            <TextView 
                android:padding="10dp" 
                android:gravity="right|center_vertical" 
                android:textAppearance="?android:attr/textAppearanceLarge" 
                android:layout_weight="0"
                android:id="@+id/textView6" 
                android:layout_height="wrap_content" 
                android:text="Ozs">
            </TextView>
            <LinearLayout 
                android:id="@+id/linearLayout3" 
                android:layout_weight="1" 
                android:layout_height="wrap_content">
                <Button 
                    android:layout_weight=".20" 
                    android:layout_height="wrap_content" 
                    android:text="-" 
                    android:id="@+id/ozsMinus">
                </Button>
                <EditText 
                    android:id="@+id/ozs" 
                    android:layout_height="wrap_content" 
                    android:layout_weight=".60" 
                    android:inputType="number">
                </EditText>
                <Button
                    android:text="+" 
                    android:layout_height="wrap_content" 
                    android:id="@+id/ozsPlus" 
                    android:layout_weight=".20">
                </Button>
            </LinearLayout>
        </TableRow>
        <TableRow 
            android:layout_height="wrap_content" 
            android:id="@+id/tableRow10" 
            android:layout_width="match_parent">
            <TextView 
                android:textAppearance="?android:attr/textAppearanceSmall" 
                android:gravity="center_vertical|center_horizontal" 
                android:id="@+id/textView3" 
                android:layout_weight="1" 
                android:layout_height="wrap_content" 
                android:text="Location Details">
            </TextView>
        </TableRow>
        <TableRow 
            android:layout_height="wrap_content" 
            android:id="@+id/tableRow11" 
            android:layout_width="match_parent">
            <TextView
                android:textAppearance="?android:attr/textAppearanceLarge" 
                android:id="@+id/TextView02" 
                android:padding="10dp" 
                android:layout_height="wrap_content" 
                android:text="Latitude" 
                android:gravity="center_vertical|right" 
                android:layout_weight="0" >
            </TextView>
            <EditText
                android:id="@+id/LatText" 
                android:layout_height="wrap_content" 
                android:layout_weight="1" 
                android:inputType="numberDecimal|numberSigned">
            </EditText>
        </TableRow>
        <TableRow 
            android:layout_width="wrap_content" 
            android:layout_height="wrap_content" 
            android:id="@+id/tableRow12">
            <TextView 
                android:textAppearance="?android:attr/textAppearanceLarge" 
                android:id="@+id/TextView03" 
                android:padding="10dp" 
                android:layout_height="wrap_content" 
                android:text="Longitude"
                android:gravity="center_vertical|right" 
                android:layout_weight="0">
            </TextView>         
            <EditText 
                android:id="@+id/LonText" 
                android:layout_height="wrap_content" 
                android:layout_weight="1" 
                android:inputType="numberDecimal|numberSigned">
            </EditText>
        </TableRow>
        <TableRow 
            android:layout_width="wrap_content" 
            android:layout_height="wrap_content" 
            android:id="@+id/tableRow13">
            <TextView
                android:textAppearance="?android:attr/textAppearanceSmall" 
                android:id="@+id/TextView04" 
                android:layout_weight="1" 
                android:layout_height="wrap_content" 
                android:text="Date" 
                android:gravity="center_vertical|center_horizontal"
                android:layout_span="2">
            </TextView>
        </TableRow>
        <TableRow 
            android:id="@+id/tableRow4" 
            android:layout_width="match_parent" 
            android:layout_height="wrap_content">
            <!-- <DatePicker
                android:layout_span="2"
                android:id="@+id/datePicker1" 
                android:layout_weight="1" 
                android:gravity="center_vertical|center_horizontal"
                android:layout_height="wrap_content">
            </DatePicker>-->
        </TableRow>

        <TableRow 
            android:layout_height="wrap_content" 
            android:id="@+id/tableRow14" 
            android:layout_width="match_parent">
            <TextView 
                android:textAppearance="?android:attr/textAppearanceSmall" 
                android:gravity="center_vertical|center_horizontal" 
                android:id="@+id/textView2" 
                android:layout_weight="1" 
                android:layout_height="wrap_content" 
                android:text="Time">
            </TextView>
        </TableRow>

        <TableRow 
            android:layout_width="wrap_content" 
            android:layout_height="wrap_content" 
            android:id="@+id/tableRow15">
            <!-- <TimePicker
                android:layout_span="2" 
                android:id="@+id/timePicker1" 
                android:layout_width="wrap_content" 
                android:layout_height="wrap_content"
                android:layout_weight="1" >
            </TimePicker>-->
        </TableRow>

        <TableRow 
            android:layout_height="wrap_content" 
            android:id="@+id/tableRow16" 
            android:layout_width="match_parent">
            <TextView 
                android:textAppearance="?android:attr/textAppearanceSmall" 
                android:gravity="center_vertical|center_horizontal" 
                android:id="@+id/textView7" 
                android:layout_weight="1" 
                android:layout_height="wrap_content" 
                android:text="Water Details">
            </TextView>
        </TableRow>
        <TableRow 
            android:id="@+id/tableRow6" 
            android:layout_width="wrap_content" 
            android:layout_height="wrap_content">
            <TextView
                android:textAppearance="?android:attr/textAppearanceLarge"
                android:paddingLeft="30dp" 
                android:id="@+id/TextView07"
                android:layout_height="wrap_content"
                android:padding="10dp"
                android:gravity="right|center_vertical"
                android:layout_weight="0"
                android:text="Clarity" >
            </TextView>
            <Spinner 
                android:id="@+id/claritySpinner" 
                android:layout_weight="1" 
                android:layout_height="wrap_content">
            </Spinner>
        </TableRow>
        <TableRow 
            android:id="@+id/tableRow7" 
            android:layout_width="wrap_content"
             android:layout_height="wrap_content">
            <TextView
                android:textAppearance="?android:attr/textAppearanceLarge" 
                android:padding="10dp" 
                android:layout_weight="0"
                android:id="@+id/TextView08" 
                android:layout_height="wrap_content"
                android:gravity="right|center_vertical"
                android:text="Temp(F)">
            </TextView>
            <EditText
                android:id="@+id/editTemp" 
                android:layout_weight="1" 
                android:layout_height="wrap_content" 
                android:inputType="numberSigned">
            </EditText>
        </TableRow>
    </TableLayout>

    <TextView 
        android:textAppearance="?android:attr/textAppearanceLarge" 
        android:paddingLeft="30dp" 
        android:id="@+id/TextView09" 
        android:layout_height="wrap_content" 
        android:paddingTop="10dp" 
        android:text="Notes" 
        android:layout_width="wrap_content" 
        android:paddingBottom="10dp">
    </TextView>
</LinearLayout>
</ScrollView>

Logcat(调试)

07-10 23:41:23.355: DEBUG/StatusBar(2462): performAddUpdateIcon icon=IconData(slot='battery' package=null iconId=108029d iconLevel=100) notification=null key=android.os.Binder@480670f0
07-10 23:41:37.218: INFO/POWER_OFF_TEST(2462): mBatteryLevel = 100   mBatteryDecimalPoint = 1
07-10 23:41:47.453: DEBUG/StatusBar(2462): performSetIconVisibility key=android.os.Binder@48067210 visible=true
07-10 23:41:47.453: DEBUG/StatusBar(2462): performAddUpdateIcon icon=IconData(slot='phone_signal' package=null iconId=10803a0 iconLevel=0) notification=null key=android.os.Binder@48067210
07-10 23:41:57.222: INFO/POWER_OFF_TEST(2462): mBatteryLevel = 100   mBatteryDecimalPoint = 1
07-10 23:42:00.035: DEBUG/UnlockClock(2462): GMT_update mRightNow.getTimeZone().getID() == America/Chicago
07-10 23:42:00.043: DEBUG/UnlockClock(2462): GMT_update current == America/Chicago, TimeZone.getTimeZone(current).getID() == America/Chicago
07-10 23:42:00.047: ERROR/StatusBarPolicy(2462): Intent : android.intent.action.TIME_TICK
07-10 23:42:00.078: DEBUG/StatusBar(2462): performAddUpdateIcon icon=IconData(slot='clock' text='11:42 PM') notification=null key=android.os.Binder@48064620
07-10 23:42:14.179: DEBUG/dalvikvm(26282): GC_FOR_MALLOC freed 9456 objects / 404792 bytes in 114ms
07-10 23:42:17.227: INFO/POWER_OFF_TEST(2462): mBatteryLevel = 100   mBatteryDecimalPoint = 1
07-10 23:42:37.234: INFO/POWER_OFF_TEST(2462): mBatteryLevel = 100   mBatteryDecimalPoint = 1
07-10 23:42:52.691: DEBUG/StatusBar(2462): performSetIconVisibility key=android.os.Binder@48067210 visible=true
07-10 23:42:52.691: DEBUG/StatusBar(2462): performAddUpdateIcon icon=IconData(slot='phone_signal' package=null iconId=10803a1 iconLevel=0) notification=null key=android.os.Binder@48067210
07-10 23:42:54.683: DEBUG/StatusBar(2462): performSetIconVisibility key=android.os.Binder@48067210 visible=true
07-10 23:42:54.687: DEBUG/StatusBar(2462): performAddUpdateIcon icon=IconData(slot='phone_signal' package=null iconId=10803a0 iconLevel=0) notification=null key=android.os.Binder@48067210
07-10 23:42:56.679: DEBUG/AlarmManagerService(2462): Kernel timezone updated to 300 minutes west of GMT
07-10 23:42:56.707: DEBUG/StatusBar(2462): performSetIconVisibility key=android.os.Binder@48067210 visible=true
07-10 23:42:56.707: DEBUG/StatusBar(2462): performAddUpdateIcon icon=IconData(slot='phone_signal' package=null iconId=10803a0 iconLevel=0) notification=null key=android.os.Binder@48067210
07-10 23:42:56.707: DEBUG/StatusBar(2462): performSetIconVisibility key=android.os.Binder@48067d98 visible=false
07-10 23:42:56.707: DEBUG/StatusBar(2462): performAddUpdateIcon icon=IconData(slot='phone_signal' package=null iconId=10803a0 iconLevel=0) notification=null key=android.os.Binder@48067210
07-10 23:42:56.714: DEBUG/StatusBar(2462): performAddUpdateIcon icon=IconData(slot='data_connection' package=null iconId=10802bb iconLevel=0) notification=null key=android.os.Binder@48067318
07-10 23:42:57.242: INFO/POWER_OFF_TEST(2462): mBatteryLevel = 100   mBatteryDecimalPoint = 1
07-10 23:42:57.562: DEBUG/StatusBar(2462): performSetIconVisibility key=android.os.Binder@48067210 visible=true
07-10 23:42:57.562: DEBUG/StatusBar(2462): performAddUpdateIcon icon=IconData(slot='phone_signal' package=null iconId=10803a1 iconLevel=0) notification=null key=android.os.Binder@48067210
07-10 23:43:00.054: DEBUG/UnlockClock(2462): GMT_update mRightNow.getTimeZone().getID() == America/Chicago
07-10 23:43:00.066: DEBUG/UnlockClock(2462): GMT_update current == America/Chicago, TimeZone.getTimeZone(current).getID() == America/Chicago
07-10 23:43:00.074: ERROR/StatusBarPolicy(2462): Intent : android.intent.action.TIME_TICK
07-10 23:43:00.097: DEBUG/StatusBar(2462): performAddUpdateIcon icon=IconData(slot='clock' text='11:43 PM') notification=null key=android.os.Binder@48064620
07-10 23:43:17.250: INFO/POWER_OFF_TEST(2462): mBatteryLevel = 100   mBatteryDecimalPoint = 1
07-10 23:43:37.257: INFO/POWER_OFF_TEST(2462): mBatteryLevel = 100   mBatteryDecimalPoint = 1
07-10 23:43:43.293: DEBUG/BatteryService(2462): update start
07-10 23:43:43.316: DEBUG/BatteryService(2462): updateBattery level:100 scale:100 status:5 health:2 present:true voltage: 4248 temperature: 290 technology: Li-ion AC powered:false USB powered:true icon:17302173
07-10 23:43:43.347: ERROR/StatusBarPolicy(2462): Intent : android.intent.action.BATTERY_CHANGED
07-10 23:43:43.347: INFO/StatusBarPolicy(2462): BAT. status:5 health:2
07-10 23:43:43.347: DEBUG/StatusBar(2462): performAddUpdateIcon icon=IconData(slot='battery' package=null iconId=108029d iconLevel=100) notification=null key=android.os.Binder@480670f0
07-10 23:43:45.293: DEBUG/BatteryService(2462): update start
07-10 23:43:45.312: DEBUG/BatteryService(2462): updateBattery level:100 scale:100 status:5 health:2 present:true voltage: 4248 temperature: 280 technology: Li-ion AC powered:false USB powered:true icon:17302173
07-10 23:43:45.347: ERROR/StatusBarPolicy(2462): Intent : android.intent.action.BATTERY_CHANGED
07-10 23:43:45.347: INFO/StatusBarPolicy(2462): BAT. status:5 health:2
07-10 23:43:45.351: DEBUG/StatusBar(2462): performAddUpdateIcon icon=IconData(slot='battery' package=null iconId=108029d iconLevel=100) notification=null key=android.os.Binder@480670f0
07-10 23:43:50.347: DEBUG/StatusBar(2462): performSetIconVisibility key=android.os.Binder@48067210 visible=true
07-10 23:43:50.351: DEBUG/StatusBar(2462): performAddUpdateIcon icon=IconData(slot='phone_signal' package=null iconId=10803a0 iconLevel=0) notification=null key=android.os.Binder@48067210
07-10 23:43:57.265: INFO/POWER_OFF_TEST(2462): mBatteryLevel = 100   mBatteryDecimalPoint = 1
07-10 23:43:58.027: DEBUG/StatusBar(2462): performSetIconVisibility key=android.os.Binder@48067210 visible=true
07-10 23:43:58.031: DEBUG/StatusBar(2462): performAddUpdateIcon icon=IconData(slot='phone_signal' package=null iconId=10803a1 iconLevel=0) notification=null key=android.os.Binder@48067210
07-10 23:44:00.023: DEBUG/UnlockClock(2462): GMT_update mRightNow.getTimeZone().getID() == America/Chicago
07-10 23:44:00.043: DEBUG/UnlockClock(2462): GMT_update current == America/Chicago, TimeZone.getTimeZone(current).getID() == America/Chicago
07-10 23:44:00.054: ERROR/StatusBarPolicy(2462): Intent : android.intent.action.TIME_TICK
07-10 23:44:00.093: DEBUG/StatusBar(2462): performAddUpdateIcon icon=IconData(slot='clock' text='11:44 PM') notification=null key=android.os.Binder@48064620
07-10 23:44:10.828: DEBUG/StatusBar(2462): performSetIconVisibility key=android.os.Binder@48067210 visible=true
07-10 23:44:10.832: DEBUG/StatusBar(2462): performAddUpdateIcon icon=IconData(slot='phone_signal' package=null iconId=10803a0 iconLevel=0) notification=null key=android.os.Binder@48067210
07-10 23:44:17.273: INFO/POWER_OFF_TEST(2462): mBatteryLevel = 100   mBatteryDecimalPoint = 1
07-10 23:44:18.500: DEBUG/StatusBar(2462): performSetIconVisibility key=android.os.Binder@48067210 visible=true
07-10 23:44:18.504: DEBUG/StatusBar(2462): performAddUpdateIcon icon=IconData(slot='phone_signal' package=null iconId=10803a1 iconLevel=0) notification=null key=android.os.Binder@48067210
07-10 23:44:37.289: INFO/POWER_OFF_TEST(2462): mBatteryLevel = 100   mBatteryDecimalPoint = 1
07-10 23:44:43.293: DEBUG/BatteryService(2462): update start
07-10 23:44:43.316: DEBUG/BatteryService(2462): updateBattery level:100 scale:100 status:5 health:2 present:true voltage: 4248 temperature: 290 technology: Li-ion AC powered:false USB powered:true icon:17302173
07-10 23:44:43.359: ERROR/StatusBarPolicy(2462): Intent : android.intent.action.BATTERY_CHANGED
07-10 23:44:43.359: INFO/StatusBarPolicy(2462): BAT. status:5 health:2
07-10 23:44:43.359: DEBUG/StatusBar(2462): performAddUpdateIcon icon=IconData(slot='battery' package=null iconId=108029d iconLevel=100) notification=null key=android.os.Binder@480670f0
07-10 23:44:45.293: DEBUG/BatteryService(2462): update start
07-10 23:44:45.316: DEBUG/BatteryService(2462): updateBattery level:100 scale:100 status:5 health:2 present:true voltage: 4248 temperature: 280 technology: Li-ion AC powered:false USB powered:true icon:17302173
07-10 23:44:45.351: ERROR/StatusBarPolicy(2462): Intent : android.intent.action.BATTERY_CHANGED
07-10 23:44:45.351: INFO/StatusBarPolicy(2462): BAT. status:5 health:2
07-10 23:44:45.355: DEBUG/StatusBar(2462): performAddUpdateIcon icon=IconData(slot='battery' package=null iconId=108029d iconLevel=100) notification=null key=android.os.Binder@480670f0
07-10 23:44:57.296: INFO/POWER_OFF_TEST(2462): mBatteryLevel = 100   mBatteryDecimalPoint = 1
07-10 23:45:00.019: DEBUG/UnlockClock(2462): GMT_update mRightNow.getTimeZone().getID() == America/Chicago
07-10 23:45:00.027: DEBUG/UnlockClock(2462): GMT_update current == America/Chicago, TimeZone.getTimeZone(current).getID() == America/Chicago
07-10 23:45:00.039: ERROR/StatusBarPolicy(2462): Intent : android.intent.action.TIME_TICK
07-10 23:45:00.062: DEBUG/StatusBar(2462): performAddUpdateIcon icon=IconData(slot='clock' text='11:45 PM') notification=null key=android.os.Binder@48064620
07-10 23:45:17.304: INFO/POWER_OFF_TEST(2462): mBatteryLevel = 100   mBatteryDecimalPoint = 1
07-10 23:45:37.312: INFO/POWER_OFF_TEST(2462): mBatteryLevel = 100   mBatteryDecimalPoint = 1
07-10 23:45:43.293: DEBUG/BatteryService(2462): update start
07-10 23:45:43.316: DEBUG/BatteryService(2462): updateBattery level:100 scale:100 status:5 health:2 present:true voltage: 4248 temperature: 290 technology: Li-ion AC powered:false USB powered:true icon:17302173
07-10 23:45:43.363: ERROR/StatusBarPolicy(2462): Intent : android.intent.action.BATTERY_CHANGED
07-10 23:45:43.363: INFO/StatusBarPolicy(2462): BAT. status:5 health:2
07-10 23:45:43.367: DEBUG/StatusBar(2462): performAddUpdateIcon icon=IconData(slot='battery' package=null iconId=108029d iconLevel=100) notification=null key=android.os.Binder@480670f0
07-10 23:45:45.293: DEBUG/BatteryService(2462): update start
07-10 23:45:45.312: DEBUG/BatteryService(2462): updateBattery level:100 scale:100 status:5 health:2 present:true voltage: 4248 temperature: 280 technology: Li-ion AC powered:false USB powered:true icon:17302173
07-10 23:45:45.328: ERROR/StatusBarPolicy(2462): Intent : android.intent.action.BATTERY_CHANGED
07-10 23:45:45.332: INFO/StatusBarPolicy(2462): BAT. status:5 health:2
07-10 23:45:45.332: DEBUG/StatusBar(2462): performAddUpdateIcon icon=IconData(slot='battery' package=null iconId=108029d iconLevel=100) notification=null key=android.os.Binder@480670f0
07-10 23:45:57.314: INFO/POWER_OFF_TEST(2462): mBatteryLevel = 100   mBatteryDecimalPoint = 1
07-10 23:46:00.031: DEBUG/UnlockClock(2462): GMT_update mRightNow.getTimeZone().getID() == America/Chicago
07-10 23:46:00.039: DEBUG/UnlockClock(2462): GMT_update current == America/Chicago, TimeZone.getTimeZone(current).getID() == America/Chicago
07-10 23:46:00.058: ERROR/StatusBarPolicy(2462): Intent : android.intent.action.TIME_TICK
07-10 23:46:00.070: DEBUG/StatusBar(2462): performAddUpdateIcon icon=IconData(slot='clock' text='11:46 PM') notification=null key=android.os.Binder@48064620
07-10 23:46:05.304: DEBUG/dalvikvm(25875): GC_EXPLICIT freed 2317 objects / 173304 bytes in 154ms
07-10 23:46:10.261: DEBUG/dalvikvm(6283): GC_EXPLICIT freed 147 objects / 6256 bytes in 107ms
07-10 23:46:15.351: DEBUG/dalvikvm(5092): GC_EXPLICIT freed 289 objects / 50824 bytes in 194ms
07-10 23:46:17.320: INFO/POWER_OFF_TEST(2462): mBatteryLevel = 100   mBatteryDecimalPoint = 1
07-10 23:46:33.554: DEBUG/dalvikvm(15202): GC_FOR_MALLOC freed 1486 objects / 477432 bytes in 80ms
07-10 23:46:37.328: INFO/POWER_OFF_TEST(2462): mBatteryLevel = 100   mBatteryDecimalPoint = 1
07-10 23:46:49.312: DEBUG/BatteryService(2462): update start
07-10 23:46:57.336: INFO/POWER_OFF_TEST(2462): mBatteryLevel = 100   mBatteryDecimalPoint = 1
07-10 23:47:00.039: DEBUG/UnlockClock(2462): GMT_update mRightNow.getTimeZone().getID() == America/Chicago
07-10 23:47:00.062: ERROR/StatusBarPolicy(2462): Intent : android.intent.action.TIME_TICK
07-10 23:47:00.066: DEBUG/UnlockClock(2462): GMT_update current == America/Chicago, TimeZone.getTimeZone(current).getID() == America/Chicago
07-10 23:47:00.093: DEBUG/StatusBar(2462): performAddUpdateIcon icon=IconData(slot='clock' text='11:47 PM') notification=null key=android.os.Binder@48064620
07-10 23:47:17.343: INFO/POWER_OFF_TEST(2462): mBatteryLevel = 100   mBatteryDecimalPoint = 1
07-10 23:47:31.289: DEBUG/BatteryService(2462): update start
07-10 23:47:31.320: DEBUG/BatteryService(2462): updateBattery level:100 scale:100 status:5 health:2 present:true voltage: 4216 temperature: 270 technology: Li-ion AC powered:false USB powered:true icon:17302173
07-10 23:47:31.355: ERROR/StatusBarPolicy(2462): Intent : android.intent.action.BATTERY_CHANGED
07-10 23:47:31.355: INFO/StatusBarPolicy(2462): BAT. status:5 health:2
07-10 23:47:31.355: DEBUG/StatusBar(2462): performAddUpdateIcon icon=IconData(slot='battery' package=null iconId=108029d iconLevel=100) notification=null key=android.os.Binder@480670f0
07-10 23:47:33.285: DEBUG/BatteryService(2462): update start
07-10 23:47:33.316: DEBUG/BatteryService(2462): updateBattery level:100 scale:100 status:5 health:2 present:true voltage: 4215 temperature: 280 technology: Li-ion AC powered:false USB powered:true icon:17302173
07-10 23:47:33.351: ERROR/StatusBarPolicy(2462): Intent : android.intent.action.BATTERY_CHANGED
07-10 23:47:33.351: INFO/StatusBarPolicy(2462): BAT. status:5 health:2
07-10 23:47:33.355: DEBUG/StatusBar(2462): performAddUpdateIcon icon=IconData(slot='battery' package=null iconId=108029d iconLevel=100) notification=null key=android.os.Binder@480670f0
07-10 23:47:37.355: INFO/POWER_OFF_TEST(2462): mBatteryLevel = 100   mBatteryDecimalPoint = 1

4 个答案:

答案 0 :(得分:1)

确保您的xmlns属性:

xmlns:android="http://schemas.android.com/apk/res/android"

仅出现在最外层元素中(在您的情况下为ScrollView)。每个文件只需要其中一个。

答案 1 :(得分:0)

在TableLayout中添加TableRow。您的第一个Layout应该是TableLayout。然后您应该使用TableRow。

使用以下

<?xml version="1.0" encoding="utf-8"?>
<ScrollView
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/Scroll"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" >
<LinearLayout
  xmlns:android="http://schemas.android.com/apk/res/android"
  android:orientation="vertical"
  android:layout_width="fill_parent"
  android:layout_height="wrap_content">
    <TableLayout 
        android:layout_height="wrap_content" 
        android:id="@+id/tableLayout3" 
        android:layout_width="fill_parent">
        <TableRow 
            android:layout_height="wrap_content" 
            android:id="@+id/tableRow8"
             android:layout_width="fill_parent">
            <TextView 
                android:textAppearance="?android:attr/textAppearanceSmall" 
                android:gravity="center_vertical|center_horizontal" 
                android:id="@+id/textView1" 
                android:layout_weight="1" 
                android:layout_height="wrap_content" 
                android:layout_width = "fill_parent"
                android:text="Fish Details">
            </TextView>
        </TableRow>
        <TableRow 
            android:layout_height="wrap_content"
             android:id="@+id/tableRow9" 
             android:layout_width="fill_parent">
            <TextView
                android:textAppearance="?android:attr/textAppearanceLarge" 
                android:padding="10dp"
                android:id="@+id/TextView01" 
                android:layout_height="wrap_content" 
                android:text="Specie" 
                android:layout_width="wrap_content"
                android:gravity="center_vertical|right">
            </TextView>
            <Spinner 
                android:layout_weight="1" 
                android:id="@+id/specieSpinner" 
                android:layout_height="wrap_content" 
                android:layout_width="fill_parent" 
                android:padding="10dp">
            </Spinner>
        </TableRow>
        <TableRow 
            android:id="@+id/tableRow5" 
            android:layout_width="wrap_content" 
            android:layout_height="wrap_content">
            <TextView 
                android:textAppearance="?android:attr/textAppearanceLarge"
                android:padding="10dp"
                android:gravity="right|center_vertical"
                android:layout_weight="0" 
                android:id="@+id/TextView06"
                android:layout_height="wrap_content"
                android:layout_width="wrap_content"
                android:text="Bait">
            </TextView>
            <Spinner
                android:id="@+id/baitSpinner" 
                android:layout_height="wrap_content" 
                android:layout_width="wrap_content"
                android:gravity="center_vertical|center_horizontal" 
                android:layout_weight="1">
            </Spinner>
        </TableRow>
        <!-- <TableRow 
            android:id="@+id/tableRow3" 
            android:layout_width="wrap_content" 
            android:layout_height="wrap_content">
            <TextView 
                android:padding="10dp" 
                android:gravity="right|center_vertical" 
                android:textAppearance="?android:attr/textAppearanceLarge" 
                android:layout_weight="0" 
                android:id="@+id/textView4"
                android:layout_height="wrap_content" 
                android:text="Inches">
            </TextView>
            <LinearLayout 
                android:id="@+id/linearLayout1" 
                android:layout_weight="1" 
                android:layout_height="wrap_content" 
                android:weightSum="1">
                <Button 
                    android:text="-" 
                    android:layout_height="wrap_content"
                    android:id="@+id/lengthMinus" 
                    android:layout_weight=".20">
                </Button>
                <EditText 
                    android:id="@+id/length" 
                    android:layout_height="wrap_content" 
                    android:inputType="number" 
                    android:layout_weight="0.60">
                </EditText>
                <Button 
                    android:text="+" 
                    android:layout_height="wrap_content" 
                    android:id="@+id/lengthPlus" 
                    android:layout_weight=".20">
                </Button>
            </LinearLayout>
        </TableRow>
        <TableRow 
            android:id="@+id/tableRow2"
            android:layout_width="wrap_content" 
            android:layout_height="wrap_content">
            <TextView 
                android:padding="10dp"
                android:gravity="right|center_vertical" 
                android:textAppearance="?android:attr/textAppearanceLarge" 
                android:layout_weight="0" 
                android:id="@+id/textView5"
                android:layout_height="wrap_content" 
                android:text="Lbs">
            </TextView>
            <LinearLayout
                android:id="@+id/linearLayout2" 
                android:layout_weight="1" 
                android:layout_height="wrap_content">
                <Button 
                    android:text="-"
                    android:id="@+id/lbsMinus" 
                    android:layout_weight=".20" 
                    android:layout_height="wrap_content">
                </Button>
                <EditText 
                    android:id="@+id/lbs" 
                    android:layout_height="wrap_content" 
                    android:layout_weight=".60"
                     android:inputType="number">
                </EditText>
                <Button 
                    android:text="+" 
                    android:id="@+id/lbsPlus" 
                    android:layout_weight=".20" 
                    android:layout_height="wrap_content">
                </Button>
            </LinearLayout>         
        </TableRow>-->
        <TableRow 
            android:id="@+id/tableRow1" 
            android:layout_width="wrap_content" 
            android:layout_height="wrap_content">
            <TextView 
                android:padding="10dp" 
                android:gravity="right|center_vertical" 
                android:textAppearance="?android:attr/textAppearanceLarge" 
                android:layout_weight="0"
                android:id="@+id/textView6" 
                android:layout_height="wrap_content" 
                android:layout_width="wrap_content"
                android:text="Ozs">
            </TextView>
            <LinearLayout 
                android:id="@+id/linearLayout3" 
                android:layout_weight="1" 
                android:layout_height="wrap_content"
                android:layout_width="wrap_content">
                <Button 
                    android:layout_weight=".20" 
                    android:layout_height="wrap_content" 
                    android:layout_width="wrap_content"
                    android:text="-" 
                    android:id="@+id/ozsMinus">
                </Button>
                <EditText 
                    android:id="@+id/ozs" 
                    android:layout_height="wrap_content" 
                    android:layout_width="wrap_content"
                    android:layout_weight=".60" 
                    android:inputType="number">
                </EditText>
                <Button
                    android:text="+" 
                    android:layout_height="wrap_content" 
                    android:layout_width="wrap_content"
                    android:id="@+id/ozsPlus" 
                    android:layout_weight=".20">
                </Button>
            </LinearLayout>
        </TableRow>
        <TableRow 
            android:layout_height="wrap_content" 
            android:id="@+id/tableRow10" 
            android:layout_width="fill_parent">
            <TextView 
                android:textAppearance="?android:attr/textAppearanceSmall" 
                android:gravity="center_vertical|center_horizontal" 
                android:id="@+id/textView3" 
                android:layout_weight="1" 
                android:layout_height="wrap_content" 
                android:layout_width="wrap_content"
                android:text="Location Details">
            </TextView>
        </TableRow>
        <TableRow 
            android:layout_height="wrap_content" 
            android:id="@+id/tableRow11" 
            android:layout_width="fill_parent">
            <TextView
                android:textAppearance="?android:attr/textAppearanceLarge" 
                android:id="@+id/TextView02" 
                android:padding="10dp" 
                android:layout_height="wrap_content" 
                android:layout_width="wrap_content"
                android:text="Latitude" 
                android:gravity="center_vertical|right" 
                android:layout_weight="0" >
            </TextView>
            <EditText
                android:id="@+id/LatText" 
                android:layout_height="wrap_content" 
                android:layout_weight="1" 
                android:inputType="numberDecimal|numberSigned">
            </EditText>
        </TableRow>
        <TableRow 
            android:layout_width="wrap_content" 
            android:layout_height="wrap_content" 
            android:id="@+id/tableRow12">
            <TextView 
                android:textAppearance="?android:attr/textAppearanceLarge" 
                android:id="@+id/TextView03" 
                android:padding="10dp" 
                android:layout_height="wrap_content"
                android:layout_width="wrap_content" 
                android:text="Longitude"
                android:gravity="center_vertical|right" 
                android:layout_weight="0">
            </TextView>         
            <EditText 
                android:id="@+id/LonText" 
                android:layout_height="wrap_content"
                android:layout_width="wrap_content" 
                android:layout_weight="1" 
                android:inputType="numberDecimal|numberSigned">
            </EditText>
        </TableRow>
        <TableRow 
            android:layout_width="wrap_content" 
            android:layout_height="wrap_content" 
            android:id="@+id/tableRow13">
            <TextView
                android:textAppearance="?android:attr/textAppearanceSmall" 
                android:id="@+id/TextView04" 
                android:layout_weight="1" 
                android:layout_height="wrap_content" 
                android:text="Date" 
                android:layout_width="wrap_content"
                android:gravity="center_vertical|center_horizontal"
                android:layout_span="2">
            </TextView>
        </TableRow>
        <TableRow 
            android:id="@+id/tableRow4" 
            android:layout_width="fill_parent" 
            android:layout_height="wrap_content">
            <!-- <DatePicker
                android:layout_span="2"
                android:id="@+id/datePicker1" 
                android:layout_weight="1" 
                android:gravity="center_vertical|center_horizontal"
                android:layout_height="wrap_content">
            </DatePicker>-->
        </TableRow>

        <TableRow 
            android:layout_height="wrap_content" 
            android:id="@+id/tableRow14" 
            android:layout_width="fill_parent">
            <TextView 
                android:textAppearance="?android:attr/textAppearanceSmall" 
                android:gravity="center_vertical|center_horizontal" 
                android:id="@+id/textView2" 
                android:layout_weight="1" 
                android:layout_width="wrap_content"
                android:layout_height="wrap_content" 
                android:text="Time">
            </TextView>
        </TableRow>

        <TableRow 
            android:layout_width="wrap_content" 
            android:layout_height="wrap_content" 
            android:id="@+id/tableRow15">
            <!-- <TimePicker
                android:layout_span="2" 
                android:id="@+id/timePicker1" 
                android:layout_width="wrap_content" 
                android:layout_height="wrap_content"
                android:layout_weight="1" >
            </TimePicker>-->
        </TableRow>

        <TableRow 
            android:layout_height="wrap_content" 
            android:id="@+id/tableRow16" 
            android:layout_width="fill_parent">
            <TextView 
                android:textAppearance="?android:attr/textAppearanceSmall" 
                android:gravity="center_vertical|center_horizontal" 
                android:id="@+id/textView7" 
                android:layout_weight="1" 
                android:layout_width="wrap_content"
                android:layout_height="wrap_content" 
                android:text="Water Details">
            </TextView>
        </TableRow>
        <TableRow 
            android:id="@+id/tableRow6" 
            android:layout_width="wrap_content" 
            android:layout_height="wrap_content">
            <TextView
                android:textAppearance="?android:attr/textAppearanceLarge"
                android:paddingLeft="30dp" 
                android:id="@+id/TextView07"
                android:layout_height="wrap_content"
                android:padding="10dp"
                android:gravity="right|center_vertical"
                android:layout_weight="0"
                android:layout_width="wrap_content"
                android:text="Clarity" >
            </TextView>
            <Spinner 
                android:id="@+id/claritySpinner" 
                android:layout_weight="1" 
                android:layout_height="wrap_content">
            </Spinner>
        </TableRow>
        <TableRow 
            android:id="@+id/tableRow7" 
            android:layout_width="wrap_content"
             android:layout_height="wrap_content">
            <TextView
                android:textAppearance="?android:attr/textAppearanceLarge" 
                android:padding="10dp" 
                android:layout_weight="0"
                android:id="@+id/TextView08" 
                android:layout_height="wrap_content"
                android:layout_width="wrap_content"
                android:gravity="right|center_vertical"
                android:text="Temp(F)">
            </TextView>
            <EditText
                android:id="@+id/editTemp" 
                android:layout_weight="1" 
                android:layout_height="wrap_content"
                android:layout_width="wrap_content" 
                android:inputType="numberSigned">
            </EditText>
        </TableRow>
    </TableLayout>

    <TextView 
        android:textAppearance="?android:attr/textAppearanceLarge" 
        android:paddingLeft="30dp" 
        android:id="@+id/TextView09" 
        android:layout_height="wrap_content" 
        android:paddingTop="10dp" 
        android:text="Notes" 
        android:layout_width="wrap_content" 
        android:paddingBottom="10dp">
    </TextView>
</LinearLayout>
</ScrollView>


EDIT by OP: Missing android:layout_width

答案 2 :(得分:0)

非常轻微的错误可能完全破坏任何人的程序并阻止其正常运行。我不打算测试这个,但我觉得它有点像'android:layout_weight =“1”'并且你没有把“1dip”放进去。在这些XML文档中编写的所有代码中都必须非常细致......它们不能很好地解析/解释。

答案 3 :(得分:0)

您提到将“layout_width”添加到按钮,我认为您走在正确的轨道上。如果将宽度设置为“0dp”,则重量仍然可以正常工作。

<Button 
    android:layout_weight=".20" 
    android:layout_height="wrap_content" 
    android:layout_width="0dp" 
</Button>