views:

99

answers:

1

Hi,

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

+1  A: 

Got it:

ApplicationDescriptor.currentApplicationDescriptor().getVersion()
Fermin