简体   繁体   中英

Home Button in Lock Screen App

如何在此锁定屏幕应用程序中禁用主页按钮: https : //play.google.com/store/apps/details?id=com.appershopper.ios7lockscreen我知道此应用程序是作为启动器创建的,但我怎么知道当用户在“锁定屏幕活动”中单击主屏幕按钮时以及在主屏幕中时?

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>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM