Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

171
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda