0

I have a view class that gets instantiated many times, with each instance listening to a different broadcast message. Since views can get destroyed or worse yet, recycled, I need a way to persist a value for the view somehow (the Broadcast message that I am supposed to listen to). Is there a simple way to do this?

4

1 回答 1

0

我认为最好的(或标准的)方法是使用onSaveInstanceStateonRestoreInstanceState方法。我不知道您需要保留什么样的数据,在某些情况下这可能是有条件的。

于 2013-05-28T14:56:59.843 回答