java - Change from one Activity to another -


so trying implement to-do list when click on item on list-view need go activity. code:

textview tvitem = (textview) findviewbyid(r.id.tvitem);  tvitem.setonclicklistener(new onclicklistener() {      @override     public void onclick(view v) {         intent = new intent(new intent(mainactivity.this, itemview.class)) ;            startactivity(it);      } 

please help

to go ne next activity add onitemclicklistner:

intent intent = new intent(this, activitytwo.class); this.startactivity (intent); 

all saving of tha activity must made on overriden method

@override public void onsaveinstancestate(bundle savedinstancestate) {   super.onsaveinstancestate(savedinstancestate);    savedinstancestate.putboolean("myboolean", true);   savedinstancestate.putdouble("mydouble", 1.9);   savedinstancestate.putint("myint", 1);   savedinstancestate.putstring("mystring", "welcome android");   // etc. } 

the savedinstancestate bundle passed again activty in it's oncreate method can retreive values again reassigned them were.

if eveything set correctly, go previous activity need call finish() on current activity.

hope helped!


Comments

Popular posts from this blog

c# - OpenXML hanging while writing elements -

php - regexp cyrillic filename not matches -

java - IntelliJ - No such instance method -