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

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -