Newbie Question from an iPhone developer.
I have called the startActivity(intent) and the new activity loads. How do I go 'back' to the calling activity once a button is pushed. 'Popping' the activity off the stack basically.
Newbie Question from an iPhone developer.
I have called the startActivity(intent) and the new activity loads. How do I go 'back' to the calling activity once a button is pushed. 'Popping' the activity off the stack basically.
Call finish()
on your newly loaded activity. This is assuming you didn't call finish()
on your previous activity (in which case you could always restart it).
If you had created the new Activity with startActivity
you just need to call finish
. If you had spawned the new Activity by calling startActivityForResults
then you need to call setResult
and then finish
in order to pass back data to the onActivityResult
method of the prior Activity.