mobile是一个Java Microedition RMS,在打开时标记为已修改,但未进行数据更改?
我想知道打开RMS记录是否会检查它是否在javame中被修改。 比如说
RecordStore rs;
//First RMS access
rs.open("gamescores",true);
rs.addRecord(null,0,0);
rs.closeRecordStore;
//Second RMS access
rs = RecordStore.open("gamescores",true);
long timeStamp = rs.getLastModified();
rs.closeRecordStore();
getLastModified()将返回第一次RMS访问或第二次RMS访问的时间
# 1 楼答案
另一种方法用于跟踪记录的修改-getVersion():
至于getLastModified方法,其规范不允许以可移植的方式可靠地告诉您所询问的差异:
# 2 楼答案
到目前为止,我从未使用过这个
getLastModified()
方法,所以我用谷歌搜索它,找到了和example。因此,是的,该方法以长格式返回上次修改的时间,您可以轻松地将其转换为日期