public final static int createLocalId ( ) { Storage storage = Storage . getLocalStorageIfSupported ( ) ; if ( storage == null ) return 0 ; int increment = 0 ; String incrementString = storage . getItem ( LOCAL_CURRENT_ID_INCREMENT ) ; try { increment = Integer . parseInt ( incrementString ) ; } catch ( Exception e ) { } increment += 1 ; storage . setItem ( LOCAL_CURRENT_ID_INCREMENT , increment + "" ) ; return - increment ; }
Create a negative ID .