Tell me, is there any one that lets you know that the activity is now open? I need to transfer information to the main Activity when closing the second activity

  • You need onAcitityResult - Yuriy SPb
  • Got it. It seems that what you need - Sergey

1 answer 1

What for? When closing, simply transfer your data via Intent .

 Intent intent = new Intent(First.this, Second.class); intent.putString("name", "Ваня"); startActivity(intent); 

In the activity of Second get Vanya:

 String name = getIntent().getStringExtra("name"); 
  • I need a reverse process. From the second pass into the main - Sergey