android - press button change text of the button loaded from edittedt but when press back button change doesn't effect and saved -


when press button text loaded edit text when button pressed changed gone away mean no changed created button , show first text no changed saved button loaded edit text.

 public class mainactivity extends activity {   private edittext text;  private static button button;  private radiobutton radio;  @override  protected void oncreate(bundle savedinstancestate) {     super.oncreate(savedinstancestate);     setcontentview(r.layout.activity_main);     text=(edittext)findviewbyid(r.id.text);     button=(button)findviewbyid(r.id.button1);     radio=(radiobutton)findviewbyid(r.id.radiobutton1);     button.setonclicklistener(new view.onclicklistener() {         @suppresslint("newapi")         @override //this api support         public void onclick(view arg0) {             button.settext(text.gettext().tostring());             //press button , changed text of button                  }     });   }  @override  protected void onsaveinstancestate(bundle outstate) {       super.onsaveinstancestate(outstate);     log.d("text's text:" + text.gettext().tostring()     + "button:" + button.gettext().tostring(), null);     //override unimplemented method     }  @override  protected void onpause() {     // todo auto-generated method stub     super.onpause();     log.d("text's text:" + text.gettext().tostring()     + "button:" + button.gettext().tostring(), null,null);     //override unimplemented method  }   @override  protected void onrestoreinstancestate(bundle savedinstancestate) {     // todo auto-generated method stub     super.onrestoreinstancestate(savedinstancestate);     log.d("text's text:" + text.gettext().tostring()     + "button:" + button.gettext().tostring(), null, null); //override   }  private void ondestroy() {     // todo auto-generated method stub     log.d("text's text:" + text.gettext().tostring()     + "button:" + button.gettext().tostring(), null, null);//override  }  } 

log.d show error out not add add arguments match d'(string,string,throwable)' add button showed no changed effect. log.d show error out not add add arguments match d'(string,string,throwable)' add button showed no changed effect. log.d show error out not add add arguments match d'(string,string,throwable)' add button showed no changed effect.

use shared preference in way changed should saved , save loaded next time want relaunch app.


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

jquery - javascript onscroll fade same class but with different div -