If an activity calls it parent activity by startActivity(intent) // Here intent is parent activity,
Then, will a new instance of the parent activty will be opened or the same background activity will come in front?
I’m asking because my parent activity contains a ListView & my child activity is performing an operation that is updating the ListView in parent activity.
As soon as the user presses the Done button in child activity, the list needs to be updated. That’s why I’m using startActivity.
Instead of using
startActivity(intent)in your parent activity, UsestartActivityForResult(intent).Doing the way you intend to do will create lot of instances of parent+child activities in your activity stack and that is not good.
In the parent activity, you can just implement
onActivityResult()method, and u can update your list.And the answer to your question, Yes a new instance of the parent activity will be created if you do that.