java - Android - how can i from window1 go to window2 then go to window3 from window3 jump back to window1? -
i have 3 window (activity). window1 buttons old pictures, window2 options change old pictures of window1, window3 preview of pictures.
when selection made in window3 want skip quite window2 + window3 , jump window1. how can that?
window1:
intent myrotationsaddpicture2 = new intent(getbasecontext(), myrotationsaddpicture.class); myrotationsaddpicture2.putextra("title", "r2.jpg"); startactivityforresult(myrotationsaddpicture2,0);
window2 / window3 ?
string whichimage = getintent().getextras().getstring("title"); protected void onactivityresult(int requestcode, int resultcode, intent data) { if (resultcode == 0) { finish(); startactivity(getintent()); } } setresult(0); this.finish(); system.exit(0);
from looks want don't want use startactivityforresult()
here...just use startactivity()
.
in activity3
use
intent intent = new intent(activity3.this, activity1.class); intent.setflags(intent.flag_activity_reorder_to_front); startactivity(intent);
use if don't want remove activity2
stack.
if want remove activity2
stack use flags
intent.setflags(intent.flag_activity_reorder_to_front|intent.flag_activity_clear_top);
or call finish()
in activity2
when moving activity3
you can find of intent flags
here in docs
Comments
Post a Comment