Retrieve persistent data

  1. Import the following classes:
    • net.rim.device.api.system.PersistentObject
    • net.rim.device.api.ui.component.Dialog
  2. Invoke getContents() on a PersistentObject.
  3. To convert to your desired format, perform an explicit cast on the object that PersistentObject.getContents()returns.
    synchronized(store) {
    String[] currentinfo = (String[])store.getContents(); 
    if(currentinfo == null) {
    Dialog.alert(_resources.getString(APP_ERROR));
    } 
    else {
    currentusernamefield.setText(currentinfo[0]);
    currentpasswordfield.setText(currentinfo[1]);
    }
    }
    

Index


Was this information helpful? Send us your comments.