android - how to return back to previous activity on back pressed? -
i have call activity a
state 2 activity a
state 1 again call activity a
state 3 activity a
state 2. how can go activity a
state 2 when press on button in android?
you can using following code-
@override public void onbackpressed() { super.onbackpressed(); = new intent(currentactivity.this, nextactivity.class); i.setflags(intent.flag_activity_clear_top); startactivity(i); finish(); }
Comments
Post a Comment