就像标题所说:你如何在Android中存储一个带共享首选项的大整数?
Big integer i;
public static void loadI() {
cash = prefs.get...?("", i);
}
public static void saveI() {
editor.put...?("", i);
}
答案 0 :(得分:1)
您可以使用以下内容:
public static void loadI() {
i = new BigInteger(prefs.getString("I", "0"));
}
public static void saveI() {
SharedPreferences.Editor editor = prefs.edit();
editor.putString("I", i.toString());
editor.apply();
}