title: Finishing Activity doesn't stop thread Android
body: <p>I have splash activity and 1 thread. Thread starts timer and after some time main activity will start.
  Unlike on other apps I don't want to disable backPressed button in Splash Activity. I want when backpressed is pressed to cancel thread and finish activity. But I can't get it to work.
  Here is my code:</p>
  
  <pre><code>        @Override
              protected void onCreate(Bundle savedInstanceState) {
                  super.onCreate(savedInstanceState);
                  setContentView(R.layout.starter);
  
                  Thread Logo = new Thread() {
                      public void run() {
  
                          try {
  
                              sleep(1 * 1500);
  
                              Intent i = new Intent(getBaseContext(),
                                      MainActivity.class);
                              startActivity(i);
  
                              finish();
  
                          } catch (Exception exception) {
  
                          }
                      }
                  };
  
                  Logo.start();
  
              }
  ...
  
  
         @Override
              public void onBackPressed() {
                  Thread.currentThread().interrupt();
                  super.onBackPressed();
                  this.finish();
              }
          }
  </code></pre>
  
  <p>But this doesn't stop thread, it only finish activity and thread keeps running in background(and ofc starts activity)</p>