I am working on a Launcher activity and I want when the user presses the home button, it will go to the launcher activity only if the launcher activity is running on screen. Is there a listener for when the launcher function is called? When I say launcher, I mean like the app Nova Launcher where it takes over the home screen when you press home.
My manifest for the activity is set up like so:
<activity
android:name="com.example.lock.LockscreenActivity"
android:label="@string/app_name"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
android:screenOrientation="portrait"
android:launchMode="singleInstance"
android:stateNotNeeded="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.HOME"/>
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
Or if was as easy as something in the manifest.
Thanks!