Nazima Kauser MMF
Nazima Kauser MMF

Reputation: 1665

How to disable hardware home button?

i have tried different approaches to disable hardware home button through key-guard and key-down. it didn't work, i want functionality like Go-locker app. when i press on home button activity didn't close. please give me any idea about it. Thanks in advance.

Upvotes: 0

Views: 256

Answers (2)

NamNH
NamNH

Reputation: 1805

Because the security reason, if any app can disable Home button, and also disables back button (onbackpress()), power button (by on/off receiver), so the app will never be killed, and your phone just shows the app. I think Go-locker has customed their laucher, you can do it, but i think it is not easy.

Regards !

Upvotes: 1

Stopfan
Stopfan

Reputation: 1757

Write this Intent filter in manifest in tag of your 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