2012-02-25 52 views
0

我試圖重現用戶報告錯誤,並且正在試圖迫使以下情形(從活動頁面中的Android開發者採取的):強制被殺害的過程和OS重新創建活動

然後,如果系統殺死你的應用程序和用戶 導航回您的活動,系統將重新創建活動和 傳遞捆綁雙方的onCreate()和onRestoreInstanceState()。

我試過在模擬器和設備上,強制關閉和試圖強制操作系統殺死進程(通過加載和使用其他應用程序),但沒有成功。上述情況已經發生的指示是如果活動傳遞了非零包(並且不是由於配置更改)。

回答

0

找到了答案here

答案是明確的:

For example, run your app so it has some activities, press 
home, use adb shell's "ps" to find your process and "kill" to kill it, then 
select it again from home. You process will be restarted, with the top-most 
activity started. None of the others will be running at this point. 
相關問題