java - Preserve edittext entry after pressing onOptionsItemSelected -


hello have reverse of this problem, entries disappear.

i want retain entries in edittext after selecting menu button. here code. have pass intents if want preserve information?

    public boolean onoptionsitemselected(menuitem item){     switch(item.getitemid()){     case r.id.seesavedroutes:         intent launchnewintent = new intent(mainactivity.this,savedroutes.class);         startactivityforresult(launchnewintent, 0);         super.onpause();         onpause();         return true;                 }     return false; } 

you shouldn't explicit call onpause, called android system. android widgets save , restore state default (note: in order android system restore state of views in activity, each view must have unique id, supplied android:id attribute.). may save additional state (or state of views without id) in onsaveinstancestate , restore in oncreate(bundle) or in onrestoreinstancestate(bundle).
please, read: this , this


Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

css - Firefox for ubuntu renders wrong colors -