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

171
Vistas
How can a React Native Android Java know if an addListener with a given name exists

I can solve the problem by using an additional flag that will get communicated from Javascript to Java. But an extra flag felt redundant to my taste. My Java native code needs to do something in its state and then notify the Javascript layer about this. But my concern is that, if the Javascript layer did not call the NativeEventEmitter::addListener, then the changes made on the Java native side won't get communicated to the Javascript side. So I first need to determine that Javascript is listening for this event. Otherwise, no state changes on the Java side.

Like I said, a trivial boolean flag and the extra native call to have this flag communicated to the Java side could solve this problem. But I worry that such extraneous method would cause things to go out-of-sync by accident, via javascript programming mistake. I, therefore, am inclined to check if Javascript is listening for the event. How can Java React Native find out if there is a listener?

about 4 years ago · Juan Pablo Isaza
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