The system owns it, so it doesn't need to allocate a new event object and array for every report. You need to copy any data you want to keep.
On Fri, Sep 18, 2009 at 11:06 AM, Daber <[email protected]> wrote: > > Hi, > > I've been experimenting with gsensors on dev phone and I think i found > something that needs explanation. > > > The appliaction was comparing g readings with previously read values > in following manner > float[] mPrevious; > > > float[] v = event.values; > > // .. compare // > > mPrevious = v; > > > but after while all comparisions were equal. > > It seems that event reuses float array object to provide new data in > the old array after some time (mPrevious and event.values is the same > object). > > Now here is The question: > Who has object "ownership" -the gsensor framework and i have to make > a copy > Me - and this is a bug > > > BR, > > Michał Dąbrowski > > > -- Dianne Hackborn Android framework engineer [email protected] Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---

