2012-03-17 19 views
1

我剛開始學習Android應用程序開發,並在嘗試不同的活動元素時注意到以下問題。我的主要活動中有以下代碼更改方向將清除TimePicker

<TableLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:id="@+id/mainLayout" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" > 

    <TableRow 
     android:id="@+id/row1" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" > 

     <TimePicker 
      android:id="@+id/timePicker1" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" /> 

    </TableRow> 

</TableLayout> 

它只是一個TimePicker活動。我的問題是,無論何時我更改移動設備的方向,TimePicker的小時選項都會變爲空白,並在LogCat中生成以下錯誤。

Saved cursor position 2/2 out of range for (restored) text 

回答