0

I am able to get mouse middle button click event in android application. But before getting this onGenericMotionEvent callback my application is going home.

I have already tried below solution, Because of this one every time while click on mouse middle button content resolver asking to select launcher for home.

added below intent filters to for my activity in the manifest to make it as a home application

  <action android:name="android.intent.action.MAIN" />
  <category android:name="android.intent.category.HOME" />
  <category android:name="android.intent.category.DEFAULT" />

I do not want to show that kind of dialog in application screen. Is there any way to handle it? How to restrict this go to home behavior? Could you please let me know if anyone has any idea about this?

  • Possible duplicate https://stackoverflow.com/questions/5547818/can-i-override-the-home-button-in-my-application – Harry T. Sep 20 '17 at 10:29
  • Here I am facing issue with mouse middle button event. before getting mouse middle event callback only application is going to background I mean android os launching a home application. This specifically happening on Samsung device. I want to restrict this behaviour in my application. – Vilasamani Mamatha Sep 20 '17 at 10:39

1 Answers1

-1

If on Samsung go to assistant and set to none then set the assistant time to quick I've been looking for a solution for the quick part but for now I have to hold the button for at least 3 seconds or else it goes to home screen I hope this helps

  • 1
    Hello and welcome. This is a site for progammers, not for end users. What I mean is that the question is about how to do it on the code side, not on the user side. :) – Eric Aya Nov 15 '21 at 23:15