Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

169
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!