android - Go back to another or old Activity from a fragment in an activity -


i have looked but, can't seem find answer need.

so, scenario is, have activitya starts activityb using intent. activityb sets values in bundle , starts fragment using fragment manager. now, want go activitya when button click. want pass variables fragment activitya. how do this?

currently, start activitya again using intent bundle of data passed in fragment. not good, because restarting activitya again. want go using onresume() or similar, old data still there in activitya again.

thanks

you can either call finish activity so:

getactivity().finish(); 

or can start activity , recall previous 1 stack:

intent = new intent(getactivity(), activitya.class); i.addflags(intent.flag_activity_clear_top); startactivity(i); 

http://developer.android.com/reference/android/content/intent.html#flag_activity_clear_top


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -