2011-09-19 34 views

回答

0

檢查下面的代碼片段:

//get the ApplicationManager 
ApplicationManager appMan = ApplicationManager.getApplicationManager(); 

//grab the running applications 
ApplicationDescriptor[] appDes = appMan.getVisibleApplications(); 

int size = appDes.length; 
for (int i = size - 1; i >= 0; --i) { 
    String moduleName = appDes[i].getModuleName(); 
    String name = appDes[i].getName(); 
    // other codes.... 
} 


另請閱讀API文檔以下類:

+0

但是,這會返回字符串值,如「net_rim_bb_messaging_app」。 –

+0

appDes [i] .getName()呢? – Rupak

+0

其工作正常... –

0

如果你想獲得的應用程序版本(編程),可以使用:

net.rim.device.api.system.DeviceInfo.getSoftwareVersion()

0

您可以獲得當前應用程序模塊的名稱或使用該行處理:

String name = ApplicationDescriptor.currentApplicationDescriptor().getModuleName(); 

這將返回此應用程序的模塊句柄的字符串。或者通過使用

int handle = ApplicationDescriptor.currentApplicationDescriptor().getModuleHandle();