question

Mark L. Price avatar image
Mark L. Price asked

How to override Home Button on Kindle Fire

We are building a children's app that allows parents that allows their kids to only use approved apps. In our app we show a list of apps on the device and allow the parent to select which ones the children can use. The problem we are running into is that we cannot override the home button on the Kindle Fire. We ARE able to do it on non-Amazon devices, but the code simply does not work for Kindle. We can't have the kids pressing the device home button to leave our app and use unauthorized apps. So my question is - how can I override the home button so that it does not take the user out of our app?
fire tablet
10 |5000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

Sujoy@Amazon avatar image
Sujoy@Amazon answered
Hi Mark, You cant. They typical way of overriding the key event in android is overriding onKey() method in activity and return false for that particular key code. public boolean onKeyDown(int keyCode, KeyEvent event) { System.out.println("keyCode = " + keyCode); if(keyCode == 4){ // Back button return false; } return super.onKeyDown(keyCode,event); } But you would not get any callback in this method while home button is pressed. This is a consistent behavior in Amazon devices that we do not allow any any to override the functionality of home button. Sorry to say that we can not help you out in this case.
10 |5000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.