/**
* Check if current widget is running (excluding daemon processes)
* @return true if running, otherwise false
*/
public static boolean isAppRunning() {
ApplicationManager mgr = ApplicationManager.getApplicationManager();
ApplicationDescriptor current = ApplicationDescriptor.currentApplicationDescriptor();
int processId = mgr.getProcessId( current );
ApplicationDescriptor[] descriptors = ApplicationRegistry.getInstance().getApplications();
// Check active descriptors against current descriptor
for( int i = 0; i < descriptors.length; i++ ) {
ApplicationDescriptor descriptor = descriptors[ i ];
int descriptorProcessId = mgr.getProcessId( descriptor );
if( !isDaemon( descriptor.getArgs() ) && descriptorProcessId != -1 && descriptorProcessId != processId ) {
return true;
}
}
return false;