Help Center

Local Navigation

Add an object in the runtime store

  1. Import the following classes:
    • net.rim.device.api.system.RuntimeStore
    • java.lang.String
    • java.lang.IllegalArgumentException
  2. Invoke RuntimeStore.put(long, String) and provide as parameters a unique long ID and the runtime object to store.
  3. Create a try - catch block to manage the IllegalArgumentException that put() throws if a runtime object with the same ID exists.
    RuntimeStore store = RuntimeStore.getRuntimeStore();
    String msg = "Some shared text";
    long ID = 0x60ac754bc0867248L;
    try {
    store.put( ID, msg );
    } catch(IllegalArgumentException e) {
    }
    

Index


Was this information helpful? Send us your comments.