title: Why my program crash when i press back Button
body: <p>[this is the list view of the songs present in sd card<a href="http://i.stack.imgur.com/hr3Ik.png" rel="nofollow">][1]</a></p>
  
  <p>****Here is my code for MainActivity****</p>
  
  <pre><code>package com.example.jawad.musicplayer;
  
  import android.content.Intent;
  import android.media.MediaPlayer;
  import android.os.Environment;
  import android.support.v7.app.AppCompatActivity;
  import android.os.Bundle;
  import android.view.View;
  import android.widget.AdapterView;
  import android.widget.ListView;
  import android.widget.Toast;
  
  import java.io.File;
  import java.util.ArrayList;
  
  public class MainActivity extends AppCompatActivity implements   View.OnClickListener
  {
  
      ListView musicListView;
      ArrayList&lt;File&gt; musicFiles;
      MediaPlayer mediaplayer;
      @Override
      protected void onCreate(Bundle savedInstanceState)
      {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
          musicListView = (ListView) findViewById(R.id.musiclistviewId);
           musicFiles = findSongs(Environment.getExternalStorageDirectory());
           CustomListViewAdapter CLV = new CustomListViewAdapter(MainActivity.this,R.layout.list_row,musicFiles);
          musicListView.setAdapter(CLV);
           musicListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
               @Override
               public void onItemClick(AdapterView&lt;?&gt; parent, View view, int position, long id) {
  
                   startActivity(new Intent(MainActivity.this,PlayerActivity.class).putExtra("music",musicFiles).putExtra("pos",position));
               }
           });
  
          /*for (int i =0 ;i &lt; music.size();i++)
          {
              toast(music.get(i).getName().toString());
          }*/
  
      }
  
      public ArrayList&lt;File&gt; findSongs(File root)
      {
          File[] files = root.listFiles();
          ArrayList&lt;File&gt; tempSongs = new ArrayList&lt;&gt;();
          for(File singlefile : files)
          {
              if(singlefile.isDirectory() &amp;&amp; !singlefile.isHidden())
              {
                  tempSongs.addAll(findSongs(singlefile));
              }
               else
              {
                  if(singlefile.getName().endsWith(".mp3"))
                  {
                      tempSongs.add(singlefile);
                  }
              }
          }
             return tempSongs;
      }
  
      public  void toast(String text)
      {
          Toast.makeText(getApplicationContext(),text,Toast.LENGTH_LONG).show();
      }
  
      @Override
      public void onClick(View v) {
  
      }
  }
  </code></pre>
  
  <p>And Here is the code of "Player Activity"</p>
  
  <pre><code>package com.example.jawad.musicplayer;
  
  import android.media.MediaPlayer;
  import android.net.Uri;
  import android.support.v7.app.AppCompatActivity;
  import android.os.Bundle;
  import android.view.View;
  import android.widget.Button;
  import android.widget.SeekBar;
  import android.widget.Toast;
  
  import java.io.File;
  import java.util.ArrayList;
  
  public class PlayerActivity extends AppCompatActivity implements View.OnClickListener
  {
  
      Button playButton;
      MediaPlayer mplayer;
      private Button prevButton;
      private  Button nextButton;
      SeekBar sb;
      Thread updateThread;
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_player);
          playButton = (Button) findViewById(R.id.playButtonId);
          prevButton=(Button) findViewById(R.id.prevButtonId);
          nextButton = (Button) findViewById(R.id.nextButtonId);
          sb = (SeekBar) findViewById(R.id.seekbarId);
  
  
  
          playButton.setOnClickListener(this);
          nextButton.setOnClickListener(this);
          prevButton.setOnClickListener(this);
  
          Bundle extra =  getIntent().getExtras();
          if(extra!=null) {
              ArrayList&lt;File&gt; list = (ArrayList) extra.getParcelableArrayList("music");
              int pos = extra.getInt("pos");
              File file = list.get(pos);
              // Toast.makeText(getApplicationContext(),file.getName().toString(),Toast.LENGTH_LONG).show();
  
              Uri URI = Uri.parse(file.toString());
              mplayer=MediaPlayer.create(getApplicationContext(),URI);
  
          }
      }
  
      @Override
      public void onClick(View v) {
          int id =v.getId();
          switch(id)
          {
              case R.id.playButtonId:
                  if(mplayer.isPlaying())
                      pauseMusic();
                   else
                      playMusic();
                  break;
              case R.id.prevButtonId:
                  break;
              case R.id.nextButtonId:
                  break;
          }
      }
  
      public void playMusic()
      {
  
          if(mplayer!= null) {
              mplayer.start();
              playButton.setBackgroundDrawable(getResources().getDrawable(android.R.drawable.ic_media_pause));
              updateThread = new Thread() {
                  @Override
                  public void run()
                  {
                      sb.setMax(mplayer.getDuration());
                      int toatalduration = mplayer.getDuration();
                      int currentposition = 0;
                      while (currentposition &lt; toatalduration  &amp;&amp; mplayer.isPlaying())
                      {
                          try
                          {
                              sleep(500);
                              currentposition = mplayer.getCurrentPosition();
                              sb.setProgress(currentposition);
                          }
                          catch (InterruptedException e)
                          {
                              e.printStackTrace();
                          }
  
                      }
                  }
  
  
              };
          }
            updateThread.start();
  
  
      }
  
  
      @Override
      public void onBackPressed() {
          updateThread.stop();
          onDestroy();
      }
  
      public void pauseMusic()
      {
           if (mplayer!=null)
           {
              mplayer.pause();
              playButton.setBackgroundDrawable(getResources().getDrawable(android.R.drawable.ic_media_play));
           }
      }
  
      @Override
      protected void onDestroy() {
          if(mplayer!=null &amp;&amp; mplayer.isPlaying())
          {
              mplayer.stop();
              mplayer.release();
              mplayer = null;
              super.onDestroy();
          }
      }
  }
  </code></pre>
  
  <p>Basically I am new to android programming and practicing to built media player in android.I have good grip over Java but still i am unable to find the solution of this problem,so your help will be welcomed.
  i have also overrided the method onBackPressed(), and in that method i stop the thread and stop the music player, butt still android studio giving me the error.</p>
  
  <p>Here is my LogCat:</p>
  
  <pre><code>08-15 14:11:00.721 1429-1429/com.example.jawad.musicplayer E/AndroidRuntime: FATAL EXCEPTION: main
  Process: com.example.jawad.musicplayer, PID: 1429
  android.util.SuperNotCalledException: Activity {com.example.jawad.musicplayer/com.example.jawad.musicplayer.PlayerActivity} did not call through to super.onDestroy()
   at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:3472)
   at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:3501)
   at android.app.ActivityThread.access$1400(ActivityThread.java:135)
   at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1249)
   at android.os.Handler.dispatchMessage(Handler.java:102)
   at android.os.Looper.loop(Looper.java:136)
   at android.app.ActivityThread.main(ActivityThread.java:5001)
   at java.lang.reflect.Method.invokeNative(Native Method)
   at java.lang.reflect.Method.invoke(Method.java:515)
   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
   at dalvik.system.NativeStart.main(Native Method)
   08-15 14:11:00.721 534-760/system_process W/ActivityManager:   Force finishing activity com.example.jawad.musicplayer/.MainActivity
  
   [08-15 14:11:00.741   534:  760 D/] HostConnection::get() New Host Connection established 0xb7cbc840, tid 760
  </code></pre>