开发者

MIDlet as singleton

开发者 https://www.devze.com 2023-01-16 02:38 出处:网络
Is it safe to implement a MIDlet class as a singleton? That is, after all, the Display class is acting like a sin开发者_C百科gleton for each and every midlet so is the midlet itself a singleton by beh

Is it safe to implement a MIDlet class as a singleton? That is, after all, the Display class is acting like a sin开发者_C百科gleton 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!


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消