title: AppWidgetProvider: having trouble with variables
body: <p>I've built a widget for home screen and declared some variables in my AppWidgetProvider class. These variables are integers and booleans.</p>
  
  <p>The problem that I'm having (its basically a java programming problem) is that whatever value I assign to my variables; when I delete the widget from the home screen and then later at some time I add the widget back to the home screen, the variables are still holding the values as of the last time the widget was on home screen. I declare the variables as follows:</p>
  
  <pre><code>public class MyWidget extends AppWidgetProvider {
      static int iPicNum = 0;
      static Boolean bClosed = false;
      ...
  </code></pre>
  
  <p>How do I reset the values of my variables every time the widget is removed from the screen and put it back on the screen again. Or if the user wishes to have more than one instances of the widget on the screen, the variables shouldn't be sharing values between them. They should be independent from each other.</p>
  
  <p>Thank you
  Faraz Azhar</p>