2.
Invoke
RuntimeStore.get()
and provide as a parameter the runtime object ID.
3.
Create a try - catch block to manage the
ControlledAccessException
that
get()
throws if the BlackBerry®
Java® Application does not have read access to the specified runtime object.
RuntimeStore store = RuntimeStore.getRuntimeStore();
try {
Object obj = store.get(0x60ac754bc0867248L);
} catch(ControlledAccessException e) {
}
Retrieve an unregistered runtime object
1.
Import the following classes:
•
net.rim.device.api.system.RuntimeStore
•
net.rim.device.api.system.ControlledAccessException
•
java.lang.RuntimeException
2.
Invoke
RuntimeStore.waitFor()
to wait for registration of a runtime object to complete.
3.
Create code to handle exceptions.
RuntimeStore store = RuntimeStore.getRuntimeStore();
try {
Object obj = store.waitFor(0x60ac754bc0867248L);
} catch(ControlledAccessException e) {
} catch(RuntimeException e) {
}
Development Guide
Runtime storage
53