android - Pause activity and go back to previous activity -


i have 2 activities. activity starts activity b when button pressed. activity b loads data on create. when press button activity b being destroyed want pause , activity a. tried:

@override public void onbackpressed() {     movetasktoback(true); } 

but gets me home screen, not activity a.

if want bring activitya front, this:

@override public void onbackpressed() {     intent intent = new intent(this, activitya.class);     intent.addflags(intent.flag_activity_reorder_to_front);     startactivity(intent); } 

this rearrange activity stack on top (showing) , b behind it. when user clicks in activitya, default behaviour finish activitya , return activityb.


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -