Blackberry - Get current application's ApplicationDescriptor object


Blackberry - Get current application's ApplicationDescriptor object



I'd like to get access to my currently running applications applicationDescriptor object. I want this so that I can get the current version number and, on the initial screen have a title like "MyApp Version x.x.x" where I get x.x.x from the ApplicationDescriptor.getVersion()

One way that I've found is to use:

ApplicationManager manager = ApplicationManager.getApplicationManager(); ApplicationDescriptor[] descriptors = manager.getVisibleApplications();  //Loop round descriptors then use... ApplicationDescriptor myApp = manager.getProcessId(descriptors[x]); 

Using the loop to check all applications seems a bit long winded to me, i'm hoping that there is an easier route.

Thanks




Live Writer Image Posting

1:



Which free blog provider would you recommend to a .NET developer?
Got it:.
What are some good widgets to add to a programming related blog (on blogger.com)?
ApplicationDescriptor.currentApplicationDescriptor().getVersion() 


wordpress-mu: other options apart buddypress to build a good blog social network home page etc…?


91 out of 100 based on 71 user ratings 1321 reviews

@