HOME button doesn't work, is it possible to listen?
Asked Answered
B

3

6

Ok here's my problem. Whenever I press the HOME button nothing happens. If i'm in an app and press it i'm not sent to the home screen like I should be.

However, if the screen is locked and i press it the screen will light up(because a key was pressed).

So from what i can tell, the system is registering the keypress for HOME but is not calling the "android.intent.category.HOME" intent.

Is there some way to monitor the HOME button, and if it's pressed call the "android.intent.category.HOME" intent from my app? I've looked all over StackOverflow, but I can't find any working way to listen for the HOME key when the HOME intent doesn't activate.

Review of issue:

HOME button press causes the system to wake up when locked, so the key obviously works..

HOME button will not cause the "android.intent.category.HOME" intent to activate, nor will it send all open apps to the background.

Any help?

Byelorussian answered 30/7, 2011 at 22:3 Comment(3)
"HOME button press causes the system to wake up when locked, so the key obviously works.." - nope, this isn't the case on my HTC Desire. If the phone is asleep then HOME does nothing. If it's awake at the lock screen pressing HOME also does nothing. What are you basing your statement on?Humerus
I second MisterSquonk's comment - on my HTC Wildfire, the screen only lights up when locked if I press the power button, no other buttons have any effectValentinavalentine
I meant that when you press a button on my phone while it's locked, the display lights up and it shows the lock screen(as it would if u pressed any other button). All I meant about that, was that obviously the HOME key on my phone isn't physically damaged :)Byelorussian
K
12

I had this problem on my TF101, I think I erased some android settings with Titanium Backup. After I rebooted the device, Home button would do nothing, some quick settings would not show up and power button would show very few options.

A lot of sites prompted me to do a factory reset (backup and restore would take a day). After trying several possible solutions I came about this thread http://forum.cyanogenmod.org/topic/19605-home-button-issues-striking-back/ that solved it.

I used the android sdk installed on my Ubuntu, using the following steps:

  1. Use adb as su to retrieve the android settings database:

    sudo platform-tools/adb -d pull /data/data/com.android.providers.settings/databases/settings.db settings.db

  2. Use sqlite3 to check if device_provisioned=1 (this setting was missing)

    tools/sqlite3 settings.db "select * from secure;" | grep provision

correct answer would be "nnn|device_provisioned|1" where nnn is the number of the line. If there was no answer, you would have to add this setting to the file.

  1. Use sqlite3 to add this setting to the file

    tools/sqlite3 settings.db "INSERT INTO secure (name,value) VALUES ('device_provisioned','1');"

  2. Put the file back on your android device

    sudo platform-tools/adb -d push settings.db /data/data/com.android.providers.settings/databases/settings.db

  3. Power down android (at first I tried the reboot option on the power button menu, but it restored my faulty settings somehow. Afterwards I pressed the power button until the device shut itself down.)

  4. Power on. The Home button was working again (along with the other missing features).

Knavish answered 21/1, 2013 at 18:59 Comment(2)
As of API 17, this setting has been moved from secure to global. So on recent ROMs, the root shell command would be sqlite3 /data/data/com.android.providers.settings/databases/settings.db "INSERT INTO global (name,value) VALUES ('device_provisioned','1');"Terrenceterrene
@PaulRatazzi Thank you! This helped me to fix lock screen, home and search buttons on my HTC after resetting to factory defaults with Cyanogenmod.Vociferate
E
0

However, if the screen is locked and i press it the screen will light up(because a key was pressed).

This is not normal Android device behavior, as others have commented. Perhaps it is normal for your model of phone, in which case, I'm sorry to hear that, as your battery life is likely to suck, since you will be forever bumping the HOME button and turning on the screen.

Is there some way to monitor the HOME button, and if it's pressed call the "android.intent.category.HOME" intent from my app?

No. You can write an activity that implements a home screen, but that seems unlikely to help you here.

Any help?

Most likely, you have some app on your device that is your default home screen and is misbehaving. Try to find and uninstall it. Or, reboot your phone in safe mode and see if that gives you control back so you can find and uninstall it. Or, factory-reset your phone.

For further discussion on this topic, please visit http://android.stackexchange.com, the home for Android end-user questions.

Ephemerality answered 30/7, 2011 at 22:30 Comment(1)
As far as I know, the only home screen I have installed is the default one. Though I do agree that it is most likely an error with the home screen... I'll try a custom homescreen app and see if that fixes it :)Byelorussian
C
0

For anyone searching for this problem still, my device's home button was disabled after a crash. I tried everything, including a reboot. There were also some other functional problems as well.

|||Once I received and answered a phone call, the problem was fixed somehow.|||

Maybe a service was disabled on accident and telephony restarted it, but hopefully this helps anyone frustrated by this problem.

Cyclo answered 17/7, 2015 at 17:31 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.