-2

How can I disable home key in android in activity programmatically

I tried by HomeKeyLocker.class and used in activity like this:

new HomeKeyLocker().lock(this);

But this is not working in any device.

Cœur
  • 34,719
  • 24
  • 185
  • 251
KrishnaJ
  • 755
  • 1
  • 7
  • 24

1 Answers1

1

You cannot disable the home key. It is user's choice is they want to leave your application.

See detailed explanation here.

Community
  • 1
  • 1
ᴛʜᴇᴘᴀᴛᴇʟ
  • 4,366
  • 5
  • 35
  • 66