title: Why should SeekBar be on 'onCreate' method?
body: <p>I wrote the code for a timer like below, but if I wrote it in a separate method, not in pre-created method like onCreate(), it doesn't work as I expected. But if I put the body part of the method in 'onCreate()', it works just as fine.</p>
  
  <p>Are there some rules or differences between writing a method in 'onCreate()' method or independently?</p>
  
  <pre><code>public void seekBarController(View view){
  
      SeekBar timerSeekBar = (SeekBar) findViewById(R.id.timerSeekBar);
      final TextView timerTextView = (TextView) findViewById(R.id.timerTextView);
  
      timerSeekBar.setMax(10*60);
      timerSeekBar.setProgress(30);
  
      timerSeekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
          @Override
          public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
  
              int minutes = (int) progress / 60;
              int seconds = (int) progress % 60;
  
              String minutessString = seconds &lt; 10? "0"+ Integer.toString(minutes): Integer.toString(seconds);
              String secondsString = seconds &lt; 10? "0"+ Integer.toString(seconds): Integer.toString(seconds);
  
              Log.i("this is progress", Integer.toString(progress));
              timerTextView.setText(minutessString+":"+secondsString);
          }
  
          @Override
          public void onStartTrackingTouch(SeekBar seekBar) {
  
          }
  
          @Override
          public void onStopTrackingTouch(SeekBar seekBar) {
  
          }
      });
  
  }
  </code></pre>