title: How to clear values of all static variables at the end of an activity Android?
body: <p>I have created an application that takes in user name and other details for a transaction and then fills them in a database. At times the application shows odd behavior by filling the SAME details in the database twice as two transactions. Even though the new values are read but not STORED in the static variables.</p>
  
  <p>Therefore I needed help in flushing the values of all my static variables at the end of each activity to avoid overriding of the previous values in a fresh transaction. </p>
  
  <p>EDIT :</p>
  
  <pre><code>  public class One
        {
    static String var;
  
        public void onCreate(Bundle savedInstanceState)
      {    
        super.onCreate(savedInstanceState);
                var="blah";
           }
     }
  
            public class Two
              {
                static String variable = One.var;
                 // This is where i am accessing the value of the variables from previous activities.
  
                //CODE
              }
  </code></pre>