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
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
Post a Comment