-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
  • 37,241
  • 25
  • 195
  • 267
Krishna Kachhela
  • 773
  • 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,466
  • 5
  • 39
  • 73