Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
angelo_f
Posts: 64
Registered: ‎05-06-2009
My Device: Not Specified
Accepted Solution

Static / Global Objects or Code

Greetings

 

I have been looking at some of the examples and notice that a different instance of the app can be run - e.g., at startup or through some context menu.

In a normal desktop app, the app will appear in its own program space and identical static variables would not be accessible from each other program.

 

E.g., if I had

static boolean myStaticVar;

 

Then each separate instance of my app would have its own variable, and changing the variable within one instance of the app would not affect the value from the other instance of the app.

 

Is this the same for Blackberry apps or are static variables global to multiple instances of the app.

 

Thanks

 

Developer
DAquilina
Posts: 587
Registered: ‎01-19-2010
My Device: BOLD 9700 OS5.0.0.x on Rogers Canada
My Carrier: Rogers

Re: Static / Global Objects or Code

No, global static variables are only accessible from the current instance of the application. My application uses an alternate entry point, and I can't even access variable of the autorun instance from the selection instance without utilizing persistent or runtime store.

 

 

Hope that helps,

~Dom

----------------------------------------------------------------------------
chown -R us ./base
~J!NX