does anybody know the difference between pressing the power button and the home button? In my app, I've tried putting a debugging statement in every lifecycle of the activity and both result the same, that is, the activity will be onPause and will be onRestart then onResume when the activity is re-opened (if we press home button earlier) or when we turn on the device again by pressing the power button (if we press power button earlier).
Having this same behaviour/sequence, I expected my camera app to run the same in both cases. But it's not. I used surfaceview to preview to camera. If the press the home button and then re-open the app, it'll run normally.
BUT, if I press the power button and then press it again to turn it on again, the surfaceView freezes and thus the preview freezes too. But the camera is actually still working (if I press the camera button, itll still capture a photo).
So I'm really stuck in what's the difference between this two...
EDIT:
After testing and testing, I've found out the difference is that when I press home button, the app will be onPause() and then the surfaceView will be destroyed. On the other hand, if I press the power button, the surfaceView is not destroyed.
Still confused on what causing the two different behavior though...