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

java - Spring Data JPA: Why findOne(id) executing delete query internally? -

python - Mongodb How to add addtional information when aggregating? -

java - Incorrect order of records in M-M relationship in hibernate -