开发者

MIDlet as singleton

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜