savestate - Saving State Of Activity Android -
how can save state of activity setbackgroundresource , settextcolor have set in if sentence remains changed when start activity again?
if (cases == 1) { textview layout = (textview) findviewbyid(r.id.textview1); layout.setbackgroundresource(r.drawable.izbrano); layout.settextcolor(color.parsecolor("#d7a308")); imageview image = (imageview) findviewbyid(r.id.imageodprto); image.setimageresource(r.drawable.o1); string strii = formatter.format(cases); text.settext(strii + "€"); }
it seems need store settings instead of activity's state. in case suggest using sharedpreferences.
Comments
Post a Comment