title: Why is my counter being reset each time after call toOncreate?
body: <p>this is my current code </p>
  
  <pre><code>public class ButtonActivity extends Activity {
      int count = 0; 
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.main);
  
          final Button button = (Button) findViewById(R.id.button);
  
          button.setOnClickListener(new OnClickListener() {
              @Override
              public void onClick(View v) {
                  button.setText("Got Pressed:" + ++count);
                  }
          });
      }
  }
  </code></pre>
  
  <p>My question why after each call of onDestroy() and the subsequent call of onCreate(), the count gets reset. I looked up on onDestroy() and saw "that  is there to let your app have a final chance to clean things up before the activity does get destroyed but it does not mean that the activity will be called" My initial idea was that count is an instance variable and that onCreate() creates a new instance of my class ButtonActivity. Can anyone confirm or refute my intial thoughts ?</p>