Static variable does not get updated in Java
<p>I am seeing a bahavior that seems absurd. In my android app I have a static variable that is updated on the occurence of an event periodically. The problem is I initialize the variable and then update it in a thread on the event. Any changes to the variable I make in the thread are not getting reflected in the subsequent call. Its getting reset to the values I originally initialized them to. Is there something I am missing?</p>

<p>One thing is the static variable is an object with multiple objects inside it and its the values I set to the variables of these inner objects that are getting reset. The variables in the outer variable are getting set though.</p>

<p>EDIT: I know I need to post code but the code in question is from a large file and is not possible to paste. In order to post I have to reproduce the behavior in a smaller test code and hence I did not.</p>

<p>EDIT2: The process just spawns one thread. The initializing is done in the main process before the thread is spawned and the event handling is done in the thread. There are no multiple threads here. </p>

<p>EDIT3: Sorry about this. Turns out its a bug in my code. I did not quite understand the events that are generated and handled and the paramter in question was getting reset. I wish I could pretend this never happend but I will at least be sure not to post here in the middle of the night all frustrated :)</p>
