Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

173
Vistas
How to disable RECENT button of a mobile programmatically through AccessibilityService in Android

I am trying to create an app , In that I want to disable all the buttons. I have managed to disable the Home, Volume and Back buttons but I'm unable to disable the Recent button.

I have tried disabling the Recent button using Accessibility but had no luck.

I'm new to Stack so guide me if I have done any mistake in asking the question.

My Code: (Which isn't working)

class MyAccessibilityService : AccessibilityService() {

    override fun onInterrupt() {

    }


    override fun onKeyEvent(event: KeyEvent?): Boolean {
        Utilsfun.ToastMsg(this,"keyevent")
        return super.onKeyEvent(event)

    }




    override fun onAccessibilityEvent(event: AccessibilityEvent?) {

        val nodeInfo = event!!.source
        val className = event.getClassName()
        priE("Accessbilityt", className.toString());

        if (className.equals("com.android.internal.policy.impl.RecentApplicationsDialog")
            || className.equals("com.android.systemui.recent.RecentsActivity")
            || className.equals("com.android.systemui.recents.RecentsActivity")
            || className.equals("com.android.systemui.recents.SeparatedRecentsActivity")
        ){

            performGlobalAction(GLOBAL_ACTION_BACK)
        }


    }


    override fun onGesture(gestureId: Int): Boolean {

        return super.onGesture(gestureId)

    }
    override fun onServiceConnected() {
        super.onServiceConnected()



        priE("Accessbilityt", "onServiceConnected");
    }

}

I'm able to detect the action with this code but not able to disable it.

over 4 years ago · Santiago Trujillo
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda