Is it possible to have several Runtime "system" event listeners?

I’m trying to generalize my code, so I’m writing separate files with corresponding functions concerning orientation, gps, wifi, read-and-write etc. so when I need something in an app, I could simply require these files and have all the functions up and running.

I need to add corresponding listeners and set up the files as the app starts, and also adapt the module on other system events. As I wouldn’t like to write the code in the “system” event listener every time, I’m wondernig - is there a way to listen for the “system” events with multiple listeners?

The problem I’m encountering is, when I try to have “system” event listeners in both orientation and gps files, only the gps file gets the event.

The listeners should  be separate.  That is the orientation events should go to your orientation listener, you GPS events to your GPS listener.  There is no reason why those can’t be included in separate module files.

I think we would need to see your code to see why it’s not working.

Rob

Bob,

thank you. It works now, even with listeners having the same name and I don’t have a clue, what caused the malfunctioning. Probably some other errors in my code :slight_smile:

I’m sorry to have bothered you with this.

The listeners should  be separate.  That is the orientation events should go to your orientation listener, you GPS events to your GPS listener.  There is no reason why those can’t be included in separate module files.

I think we would need to see your code to see why it’s not working.

Rob

Bob,

thank you. It works now, even with listeners having the same name and I don’t have a clue, what caused the malfunctioning. Probably some other errors in my code :slight_smile:

I’m sorry to have bothered you with this.