title: Android ProgressBar Shut Down Application
body: <p>I am developing a beginner level android application. I am using <code>CountDownTimer</code> and <code>ProgressBar</code> together. But the application closes when I use another progress bar for a different task. I cannot even use a <code>SeekBar</code> or <code>ProgressBar</code>.</p>
  
  <p>I need to use another <code>CountDownTimer</code> with <code>ProgressBar</code>.
  The application closes when I call the required function in the Java.</p>
  
  <p>Note: Both of countdown will work without progress bar.</p>
  
  <pre><code>private void ExamleSeekBar() {...}
  
      seekBar=(SeekBar)findViewById(R.id.seekBar);
      seekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
  
          @Override
          public void onProgressChanged(SeekBar seekBar, int progress,
                                        boolean fromUser) {
              Toast.makeText(getApplicationContext(),"seekbar progress: "+progress, Toast.LENGTH_SHORT).show();
          }
  
          @Override
          public void onStartTrackingTouch(SeekBar seekBar) {
              Toast.makeText(getApplicationContext(),"seekbar touch started!", Toast.LENGTH_SHORT).show();
          }
  
          @Override
          public void onStopTrackingTouch(SeekBar seekBar) {
              Toast.makeText(getApplicationContext(),"seekbar touch stopped!", Toast.LENGTH_SHORT).show();
          }
  </code></pre>
  
  <p>Erorr:</p>
  
  <pre><code>07-05 05:34:00.515 1792-5244/? W/audio_hw_generic: Hardware backing HAL too slow, could only write 0 of 720 frames
  07-05 05:34:00.533 6610-6610/sengoz.yavuz.MyApp D/AndroidRuntime: Shutting down VM
  07-05 05:34:00.535 1792-5244/? W/audio_hw_generic: Hardware backing HAL too slow, could only write 0 of 720 frames
  07-05 05:34:00.556 6610-6610/sengoz.yavuz.MyApp E/AndroidRuntime: FATAL EXCEPTION: main
      Process: sengoz.yavuz.MyApp, PID: 6610
      java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.SeekBar.setOnSeekBarChangeListener(android.widget.SeekBar$OnSeekBarChangeListener)' on a null object reference
          at sengoz.yavuz.MyApp.MainActivity.ExamleSeekBar(MainActivity.java:1472)
          at sengoz.yavuz.MyApp.MainActivity.ScoreDialog(MainActivity.java:1322)
          at sengoz.yavuz.MyApp.MainActivity.access$1500(MainActivity.java:32)
          at sengoz.yavuz.MyApp.MainActivity$9$7.onClick(MainActivity.java:1079)
          at android.view.View.performClick(View.java:6597)
          at android.view.View.performClickInternal(View.java:6574)
          at android.view.View.access$3100(View.java:778)
          at android.view.View$PerformClick.run(View.java:25883)
          at android.os.Handler.handleCallback(Handler.java:873)
          at android.os.Handler.dispatchMessage(Handler.java:99)
          at android.os.Looper.loop(Looper.java:193)
          at android.app.ActivityThread.main(ActivityThread.java:6642)
          at java.lang.reflect.Method.invoke(Native Method)
          at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
  </code></pre>