I wanna save the value of my textview in a onstop
and onpause
. But the value that is in the textview
is a double
, how can cast putint
to double
or use something else for it
This is my code How can i solve this?
@Override
protected void onStop()
{
super.onStop();
savedValues.edit().putInt("price", (double)price).apply();
}
尝试这个
savedValues.edit().putString("price",Double.parseDouble(price)).apply();
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.