Android Java get if minimized -


is there anyway check if application minimized or if have locked device? because when minimize / lock device application still runnig, because i'd pause music / sfx not annoy people.. if calling.

i using activity , surfaceview threads.

i have tried putting pause method in surfacedestroyed / surfacechanged without success.

you should understand activity lifecycle first

enter image description here

when activity comes int foreground it'll enter onpause() , it'll enter onresume if user returns activity, example use onpause this

@override public void onpause() {     super.onpause();  // call superclass method first      // stuff here     } } 

for furthere reference onpause can see here -> onpause tutorial


Comments

Popular posts from this blog

Perl - how to grep a block of text from a file -

delphi - How to remove all the grips on a coolbar if I have several coolbands? -

javascript - Animating array of divs; only the final element is modified -