I have been trying to write a library which i can later use for my other apps. The problem is,
Once my app(main app) says my library to monitor it. The library will have to check every time the app(main app) enters to foreground. And each time it has to show a lock screen. All these have to be handled in the library.
My approach: I tried getting running tasks info by using getRunningTasks in a intent service. But this method is deprecated from lollipop. (I need a work around for this.)
Note: I don't want to check every time the any app enters foreground or not. If there will be a way to get notified just when my app enters foreground will be helpful(All the handling should happen in the library, my main app will just say to monitor or not monitor i.e a boolean thats it).
Thanks in advance.