Activity Life cycle - Screen Lock button?
When we press Home button it calls onPause() method of activity. and my
observation was that even when we press screen lock button then it should
only call onPause().
But When I press screen lock button then it first call onPause() then
onDestroy() and again onCreate()
So problem is that- I am creating media player which I am releasing on
onDestry()(because it should stop when app is closed ). But as soon as I
lock the screen then my mediaplayer stop (because onDestroy() is called).
But it should not be stop.
How to get over this?
No comments:
Post a Comment