I would like to know when the user pressed the home button while he was running my app.
BUT:
The problem is that I don't want to edite the existing code.
meaning I don't want to add logic to the existing activities onPause()
method.
The only solution I found was to add a service to the application which listens to the Log detecting if there was an intent to run the
HOME: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.HOME]
Is there any other way to do it or is it really impossible? The optimal solution would have been to catch an intent in the Manifest.xml, like:
action android:name="android.intent.category.HOME"
and implement a new class to catch it. (But it doesn't seem to catch it).