Search code examples
javaandroidservicebroadcastreceiverpower-management

Running my application when another app is loaded



It's a litle bit hard to explain, but i'll try..
There is my app, lets call it appA and another app (that I DIDN'T create, which already exist), lets call it appB. I want that the moment appB is loaded, appA will load too.
I know it's basically possible by setting a service with an interval of seconds, but it obviously will drain battery.
Or I could somehow make a BroadcastReciever and implement a listener to appB, but I have no idea how to do this...
Is it possible in a less battery-draining way?
And if the second way I suggested is the best, how can I do this?
Thank you very much!


Solution

  • Its is not possible. If it was possible, you could create an application that opens itself every time another application is launched, and this is an effect that viruses usually have.