2

在Honeycomb模擬器上測試我的應用程序時出現了一個非常奇怪的問題。當「平板電腦」旋轉到肖像,我的主Activity似乎只是卡住了,並重新開始自己一遍又一遍。下面的堆棧跟蹤似乎沒有指出發生了什麼,而且在調試時我還無法確定重新啓動。同樣的事情不會發生在使用相同肖像佈局的薑餅手機上。蜂窩活動自發地重啓自己

我沒有蜂窩設備(還),所以我不能看到這是否是模擬器的怪癖。

08-02 21:28:02.137: INFO/ActivityManager(81): Starting: Intent { cmp=com.espian.formulae.pro/.Host (has extras) } from pid 419 
08-02 21:28:02.193: WARN/WindowManager(81): Failure taking screenshot for (354x230) to layer 21010 
08-02 21:28:04.136: INFO/ActivityManager(81): Starting: Intent { cmp=com.espian.formulae.pro/.Host (has extras) } from pid 419 
08-02 21:28:04.209: WARN/WindowManager(81): Failure taking screenshot for (354x230) to layer 21015 
08-02 21:28:04.230: WARN/ActivityManager(81): Launch timeout has expired, giving up wake lock! 
08-02 21:28:06.127: DEBUG/dalvikvm(419): GC_CONCURRENT freed 105K, 3% free 7353K/7559K, paused 13ms+161ms 
08-02 21:28:06.178: WARN/ActivityManager(81): Activity idle timeout for ActivityRecord{40841ae0 com.espian.formulae.pro/.Host} 
08-02 21:28:06.517: INFO/ActivityManager(81): Starting: Intent { cmp=com.espian.formulae.pro/.Host (has extras) } from pid 419 
08-02 21:28:06.567: WARN/WindowManager(81): Failure taking screenshot for (354x230) to layer 21020 
08-02 21:28:08.447: INFO/ActivityManager(81): Starting: Intent { cmp=com.espian.formulae.pro/.Host (has extras) } from pid 419 

在此先感謝您的幫助

+0

這不是我上面提到的嗎?它只是重複之後 –

+0

這是來自DDMS –

+0

Logcat的任何見解? –

回答

3

我終於找到了問題!我在ActionBar中有一個微調,並且沒有意識到當第一次創建活動時監聽器被激活。在風景中,這只是在多視圖窗格中添加了另一個菜單(我最近注意到它是另一個bug),但是在每次創建最後一個窗口時,肖像都會觸發一個新的活動。

0

您是否嘗試過在清單中的Actvity標籤下添加

android:configChanges="keyboardHidden|orientation" 

,和壓倒一切的

@Override 
     public void onConfigurationChanged(Configuration newConfig) { 
      // TODO Auto-generated method stub 
      super.onConfigurationChanged(newConfig); 
     } 

在同上述方法活動...

+0

它仍然繼續這樣做,我是否應該在這個方法中加入任何東西,或者保留它作爲上面的內容? –

+0

就像我所說的。並記住要投入適當的活動。這兩個標記和方法.. – ngesh

+0

已找到我的代碼在很多狩獵(見上文)後的錯誤,但無論如何感謝您的建議 –