You should pass the requestcode as shown below in order to identify that you got the result from the activity you started.
myapplication import import android.os.Bundle import import import import . You can use putExtras () method to pass values between activities: In Child Activity: Intent data new Intent () data.putExtra ('myData1', 'Data 1 value') data.putExtra ('myData2', 'Data 2 value') // Activity finished ok, return the data setResult (RESULTOK, data) finish () And in Parent activity, you can override onActivityResult () and. In this article, we are going to see how we can add a back button to an activity through which we can go back to its previous activity. In order to start an activity which should return result to the calling activity, you should do something like below. myapplication import import import android.os.Bundle import import import import import import import import .ActivityResultContracts import public class MainActivity extends AppCompatActivity This method send back the result to calling Activity via Intent.