'How can I start an overlay to redirect back to my app when user opens another app?
I want to implement a function into my app that is similar to the "Forest" app. The Forest app is a productivity app. You set a timer and during that period, if you open certain apps an overlay (picture below) would come up prompting you to continue focussing and you can't interact with the app you opened while the overlay is showing. I want to add this function to my app but I'm not sure how to go about doing so. I've only figured out how to detect when the user is trying to use an app by using UsageStatsManager
(not sure if this is the best way but it seems to work). If you have any ideas please let me know.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|