Commit f39fcc25 authored by Pranav Shrihari's avatar Pranav Shrihari
Browse files

Fixing background music

parent 07866fa9
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -57,7 +57,6 @@ public class ChalkActivity extends AppCompatActivity implements View.OnClickList
        // BGM
        backgroundMusic = MediaPlayer.create(this,R.raw.tanpopo);
        backgroundMusic.setLooping(true);
        backgroundMusic.start();

        //for pop up intro
        layout = findViewById(R.id.chalkActivity); // relative is the id of the layout of the page
@@ -209,11 +208,15 @@ public class ChalkActivity extends AppCompatActivity implements View.OnClickList
                .show();*/
    }

    protected void onStart() {
        super.onStart();
        backgroundMusic.start();
    }

    protected void onPause() {
        super.onPause();
        backgroundMusic.stop();
        backgroundMusic.pause();
    }

    /*void restartQuiz(){
        chalkscore = 0;
        currentQuestionIndex = 0;
+6 −2
Original line number Diff line number Diff line
@@ -32,7 +32,6 @@ public class MainActivity extends AppCompatActivity {

        backgroundMusic = MediaPlayer.create( this, R.raw.moog_city_two );
        backgroundMusic.setLooping(true);
        backgroundMusic.start();

        ActionBar actionBar = getSupportActionBar();
        if (actionBar != null) {
@@ -43,8 +42,13 @@ public class MainActivity extends AppCompatActivity {
        setContentView(new Game(this));
    }

    protected void onStart() {
        super.onStart();
        backgroundMusic.start();
    }

    protected void onPause() {
        super.onPause();
        backgroundMusic.stop();
        backgroundMusic.pause();
    }
}
 No newline at end of file
+6 −2
Original line number Diff line number Diff line
@@ -75,7 +75,6 @@ public class NameActivity extends AppCompatActivity implements View.OnClickListe
        QuestionAnswer QA = new QuestionAnswer(); // Create an instance of MyClass
        QA.run(this); // Call the run method on myObject, passing in the context object

        backgroundMusic.start();
        backgroundMusic.setLooping(true);

        yes.setOnClickListener(this);
@@ -203,9 +202,14 @@ public class NameActivity extends AppCompatActivity implements View.OnClickListe
        loadNewQuestion();
    }

    protected void onStart() {
        super.onStart();
        backgroundMusic.start();
    }

    protected void onPause() {
        super.onPause();
        backgroundMusic.stop();
        backgroundMusic.pause();
    }

}
 No newline at end of file