I understand how to pass data from the current activity to the second activity using intent.putExtra.
These posts explain it very well: activity to activity callback listener
How do I pass data between Activities in Android application?
However what I'm interested in is that the second activity will send data back to the first activity that opened it.
Say, MeetActivity is my main activity, and then I activate EditProfileActivity which is the secondary activity:
override fun startEditProfile() {
startActivity(EditProfileActivity.newIntent(this))
overridePendingTransition(R.anim.slide_in_up, R.anim.slide_out_down)
}
In the EditProfileActivity I created a companion object:
companion object {
fun newIntent (context: Context?) = Intent(context, EditProfileActivity::class.java)
}
Still I don't understand how MeetActivity which is the main activity, can receive back information from EditProfileActivity (second activity) Thanks in advance