Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 908507
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T16:43:42+00:00 2026-05-15T16:43:42+00:00

I just created my own Home to replace the stock android one or Sense.

  • 0

I just created my own “Home” to replace the stock android one or Sense.

All is working fine and I get all I want. My only problem is to replace to long press on home key ( that usually show the last 6 activities you launched) by my own launcher.

I successfully replace the long press on MENU button with this code:

@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {

//Log.i(TAG,"Keycode: "+keyCode);

if (keyCode == KeyEvent.KEYCODE_MENU) {
    // this tells the framework to start tracking for
    // a long press and eventual key up. it will only
    // do so if this is the first down (not a repeat).

    event.startTracking();
    return true;
}
(...)

and this part part for the long press:

  @Override
    public boolean onKeyLongPress(int keyCode, KeyEvent event) {

        //Log.i(TAG,"LONG"+keyCode);
        Toast.makeText(Launcher.this,"LONG "+keyCode, Toast.LENGTH_SHORT).show();

        if (keyCode == KeyEvent.KEYCODE_MENU) {
        (...)

But the problem is that I wasn’t able to replace the KeyEvent.KEYCODE_MENU with KeyEvent.KEYCODE_HOME

is that something locked in the code that avoid user to use a Home long press?

Thank a lot for all the information you woulg give me.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T16:43:42+00:00Added an answer on May 15, 2026 at 4:43 pm

    Everything I have ever read states that this can’t be done… Here is a post on Android Beginners where I asked a very similar question:

    http://groups.google.com/group/android-beginners/browse_thread/thread/d8cdcd1c52d79ef1/0f4b184da6f248a9?lnk=gst&q=home+key#0f4b184da6f248a9

    However, I have recently come across an app that successfully allows you to launch it by double-tapping the home key so there has got to be something that can be done. I looked into that approach for a while but couldn’t get it to work. Now that I know someone else figured it out I’m going to take another stab at it….

    EDIT
    While overriding a long-press of the home button cannot be done, I have found a way to successfully implement a double-press of the home button. The general idea for this is as follows:

    1. Make your app act as a home replacement app (Look at the sample home app in the SDK samples)
    2. Allow a way in your app to specify a home app to use (it is pretty straightforward to present the user a list of home-replacement apps)
    3. On the first press of the home button start a timer.
    4. If the timer times out, launch the home application
    5. If the user presses the home key a second time before the timer stops, launch your app

    Essentially, the home-replacement activity does nothing more than either launch the real home app specified by the user or launch your app… It never displays its own UI.

    I have found that this works pretty well, and actually have an app published in the Android Market that does this. If you would like to see it in action, it is called “Quick Launch” and the publisher name is listed as “MagouyaWare”

    Hope this helps!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i just created my own library on this folder (application/library) and following all steps
How can I create my own login form on frontend? I don’t just want
Just created a WSS site with a some custom web-parts. But I get an
I just created an profile site, that lets every registred user enter their own
I just created a Facebook App and I want to: 1. user logs in
Right now I'm trying to create my own tiny MVC (just for practice and
Just created a .dll file that has some methods. And I have a another
Just created an acc on SO to ask this :) Assuming this simplified example:
I just created an exe with cx_Freeze and proudly handed it over to a
I just created an implementation of LinkedList(just for self-education purpose.). I made it run,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.