2013-12-22 16 views

回答

0

也許你應該啓動一個CallListener服務來監視當前的呼叫狀態。而且在你的onPause()方法中,你應該用一個pref保存你的當前狀態,或者你可以將它保存到一個.txt文件中。當呼叫結束時,在CallListener類中放置一個方法,以便重新啓動服務。

+0

你認爲這需要太多時間嗎?例如我有500個項目的列表視圖,每個項目我有plurials的信息。我不知道我們是否有類似於保存當前上下文,然後在通話結束後恢復它的內容? – user3126338

+0

看看[鏈接](http://stackoverflow.com/questions/6998137/android-preferences-saving-in-activity-or-preferenceactivity)這和[鏈接](http://developer.android.com/reference /android/app/Activity.html#SavingPersistentState)。這可能會回答你的問題。 –

+0

也遵循[this](http://stackoverflow.com/questions/20044508/how-to-save-and-retrieve-listitems-in-android) –