2010-07-09 80 views
1

我想暫時禁用設備旋轉上的視圖更改。當我旋轉設備並重新開始時,它給出了封閉的錯誤。處理設備旋轉

我已經在任何地方使用過選項卡活動。

我應該如何繼續?

+0

請注意,您至少應該將配置更改處理爲不會崩潰的級別:) – alexanderblom 2010-07-09 07:25:03

回答

3

在你的清單,你可以定義哪些活動你不想通過設置即

android:screenOrientation="portrait" 
2

您可以在清單中添加這種自動旋轉:

<activity android:name=".YourActivity" 
       android:screenOrientation="portrait" 
       android:label="@string/activity_label"/> 

GER

1

您需要設置的是清單中活動的configChanges屬性。這仍然允許用戶旋轉'手機,但告訴Android不要重新啓動您的活動。