I want to make a exam app I want to apply a feature in my app in this feature when student minimize app then exam will automatically cancelled. so they can't cheat so please tell me what will and how will I do this in Android app in adt.
Asked
Active
Viewed 328 times
1
-
3You can handle the cancel logic in onStop of the Activity lifecycle method – WenChao Jan 13 '17 at 02:47
2 Answers
1
In your exam activity, override onPause()
and paste cancel exam method
before super.onPause()
.
Edit: I think you need onPause()
instead of onStop()
. Learn more about Activity Life cycle

Harry T.
- 3,478
- 2
- 21
- 41