How to get a list of background processes on BlackBerry

不问归期 提交于 2019-12-07 07:14:47

问题


I'm looking for something corresponding to net.rim.device.api.system.ApplicationManager.getVisibleApplications(), but including applications that might not/do not have a UI. Any ideas?

Unreasonably complicated work-around solutions welcome, I'm growing slowly more sure that there's not a simple single call to do this...


回答1:


If you know the application name you can detect if it is running or not by checking the size of the array containing all AppDescriptor actually running this app.

int codeModuleHandle = CodeModuleManager.getModuleHandle(applicationPackageName);

if (codeModuleHandle != 0) {
   ApplicationDescriptor[] apDes = CodeModuleManager.getApplicationDescriptors(codeModuleHandle);
}

You could imagine a code to get all installed application and then check



来源:https://stackoverflow.com/questions/7742248/how-to-get-a-list-of-background-processes-on-blackberry

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!