diff --git a/app/src/main/java/cy/agorise/crystalwallet/activities/IntroActivity.java b/app/src/main/java/cy/agorise/crystalwallet/activities/IntroActivity.java index 555ca66..17ec920 100644 --- a/app/src/main/java/cy/agorise/crystalwallet/activities/IntroActivity.java +++ b/app/src/main/java/cy/agorise/crystalwallet/activities/IntroActivity.java @@ -54,6 +54,14 @@ public class IntroActivity extends CustomActivity { @BindView(R.id.btnImportAccount) public Button btnImportAccount; + /* + * For the window animation + * */ + private MediaPlayer mediaPlayer; + + + + @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); @@ -66,7 +74,7 @@ public class IntroActivity extends CustomActivity { @Override public void surfaceCreated(SurfaceHolder surfaceHolder) { //Log.d(TAG,"surfaceCreated"); - MediaPlayer mediaPlayer = MediaPlayer.create(IntroActivity.this, R.raw.appbar_background); + mediaPlayer = MediaPlayer.create(IntroActivity.this, R.raw.appbar_background); mediaPlayer.setDisplay(mSurfaceView.getHolder()); mediaPlayer.setLooping(true); mediaPlayer.start(); @@ -148,6 +156,15 @@ public class IntroActivity extends CustomActivity { startActivity(intent); } + @Override + protected void onDestroy() { + super.onDestroy(); + + //Release the media player + mediaPlayer.release(); + mediaPlayer = null; + } + @OnClick(R.id.btnImportAccount) public void importAccount() { FragmentTransaction ft = getSupportFragmentManager().beginTransaction();