私のtextviewの値をonstop
とonpause
に保存します。しかしtextview
にある値がdouble
で、put putをput intの代わりに使用するには
をdouble
にputint
を鋳造またはそれのために何か他のものを使用することができますどのようにこれは私がこの問題を解決することができますどのように私のコード のですか?
@Override
protected void onStop()
{
super.onStop();
savedValues.edit().putInt("price", (double)price).apply();
}
[SharedPreferencesを2つ入れることができません]の複製が可能です(http://stackoverflow.com/questions/16319237/cant-put-double-sharedpreferences) – Submersed
http://stackoverflow.com/a/28309536/2308683 –
@クリケット_007ありがとうございました:) –