user16457
user16457

Reputation: 11

Home Button in Lock Screen App

How home button is disabled in this Lock Screen app: https://play.google.com/store/apps/details?id=com.appershopper.ios7lockscreen I know that this app is created as launcher but how can I get to know when user click home button in Lock Screen Activity and when in home screen?

Upvotes: 1

Views: 3232

Answers (1)

Saket
Saket

Reputation: 3076

You cannot listen to the home button press event in Android for obvious reasons. As a user, I wouldn't like that.

However, if you want your activity to be triggered when the home button is pressed (similar to how launcher apps work), you can add an intent filter to that activity:

<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>

Upvotes: 1

Related Questions