Reputation: 259
I want to create an Android application for conducting Quiz (at University level). While the quiz is progressing, I don't want users to go out of the app and search Internet/use any other app and answer. I dont want the user to exit the app unless they explicity submit/exit the quiz upto what they have done.
I have tried making it as launcher app but I couldn't take control of task switcher button. Also, I was not able to disable notification area.
If I cannot restrict this much, I want to monitor what they are doing while quiz is progressing. I can get any permissions or be device administrator or anything but I cannot restrict internet access as the server of the quiz is in internet. If a call or notification comes, I dont want that to popup while quiz is progressing etc.
Atleast, I want to log everything to server if they have done anything intentional. How can I achieve this?
Thanks
Upvotes: 0
Views: 108
Reputation: 1745
You can finish the activity in onStop() or you can use this on the activity in AndroidManifest.xml
android:launchMode="singleTask"
android:noHistory="true"
Upvotes: 0
Reputation: 21
listening for onStop in your Activity might do the trick.
see: https://developer.android.com/training/basics/activity-lifecycle/stopping.html
Upvotes: 1