MIDlet as singleton
-
02-10-2019 - |
Question
Is it safe to implement a MIDlet
class as a singleton? That is, after all, the Display class is acting like a singleton for each and every midlet so is the midlet itself a singleton by behaviour so that implementing it as such wouldn't break something?
In other words, it is not possible to have two instances of an app running, is it? I mean, the AMS wouldn't allow it, would it?
Thanks!
Solution
Normally Singleton classes have protected constructor, and this will cause a problem because the AMS needs the MIDlet class constructor to be public not protected nor private.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow