Best practice for monitoring and killing an activity from a background service?
<p>I'm trying to figure out the most efficient way of using <code>ActivityManager</code> to programmatically monitor when a package is running/executed, and then to programmatically kill it. I can do it on demand using <code>manager.killBackgroundProcesses(processName)</code> with 2.2, and my code works fine for that, but i'd like to register a background service monitor if possible.. Or some sort of an intent launching monitor for the specific package name?</p>

<p>What would be the most efficient and dependable way to do this? </p>

<p>Note: This isn't for any sort of a behind-the-scenes, malicious kill... I am calling <code>&lt;uses-permission android:name="android.permission.KILL_BACKGROUND_PROCESSES" /&gt;</code> in my manifest, so users will know exactly what the app does.</p>
