I want to develop a custom launcher android for Samsung Tablet where user can only exit the launcher with a passcode input.
Currently I face problem in recent app button. If user click recent app button, and then click the recent app, then click backpressed, device will go to TouchWiz launcher even I already set my launcher as a default launcher. Also, I disable the notification bar so user can't access it. However, when it go to TouchWiz via backpressed at recent app, the notification also disable, it should be able when in TouchWiz launcher.
My proposed solution is to detect when user click recent app and forbid any action that can cause the changes of current view.
I can't detect the recent app clicked. So I use onPause()
to detect if my app is on foreground or background. If is in onPause()
then my app is on background, if so, I do startActivity(myLauncher)
so other app won't launched.