0

The java and/or XML file seems to reload on wake from pause but I thought @Override would stop that. How do I stop this from happening?

    @Override
    public void onPause() {
        super.onPause();

        Playsound2.stop();
    }

    @Override
    public void onResume() {
        super.onResume();

        SoundManager.getInstance();
        SoundManager.initSounds(this);
        SoundManager.loadSounds();
    }

Perhaps I was unclear. How do I stop the activity restarting on wakeup?

4

2 回答 2

1

onResume Method will be called every time your activity gets Resumed. if you do not want that, use your code in some method of your own apart from activity because activity methods have a life cycle and they follow the same hierarchy.

于 2013-10-06T06:09:31.043 回答
1

@Override means you override the method from the parent class.

onResume is part of the Activity's lifecycle and will be called automatically.

于 2013-10-06T06:11:48.397 回答