我用
long lvalue = Long.parseLong(string);
prefEditor.putLong(m_strfileName, lvalue);
prefEditor.commit();
然后我做
SharedPreferences oSettings = getSharedPreferences("FONECLAY", 0);
long strValue = (long) oSettings.getLong(string, 0l);
这里我收到错误 E/AndroidRuntime(20770): java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.Long