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

180
Vistas
Android : how to NOT bring the app to front when the user clicks on a button in the notification?

I have got a notification with buttons on it and these buttons modify the notification interface when the user clicks on one of them.

The notification interface updates properly but...the main activity of my app is also brought to front.

How to avoid bringing the app to front?

Thanks !!!

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

Found the solution !

The intent of the notification has to fire a service and not an activity.

Intent buttonsIntent = new Intent(this, NotificationManagementService.class);
        buttonsIntent.putExtra("do_action", action);
        contentView.setOnClickPendingIntent(R.id.notifButton, PendingIntent.getActivity(this, 0, buttonsIntent, PendingIntent.FLAG_UPDATE_CURRENT));
        notification.contentView = contentView;
  mNotificationManager.notify(1, notification);
over 4 years ago · Santiago Trujillo Denunciar
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