radio button - RadioGroup add RadioButton duplicate when standby phone android -
i have problem radiogroup , add dynamically radiobutton have function: private void createradio() { radiogroup rgp= (radiogroup) findviewbyid(r.id.radiogroup); radiogroup.layoutparams rprms; for(int i=0;i<radios.length();i++){ radiobutton radiobutton = new radiobutton(this); try { jsonobject object = radios.getjsonobject(i); radiobutton.settext(object.getstring("name")); radiobutton.setid(object.getint("id")); rprms= new radiogroup.layoutparams(radiogroup.layoutparams.wrap_content, radiogroup.layoutparams.wrap_content); assert rgp != null; rgp.addview(radiobutton, rprms); } catch (jsonexception e) { e.printstacktrace(); } } } where radios jsonarray retrieve db. , problem when put in "stand by" app, , activity stopped when reopen activity found value of