インテントにエクストラを追加できます。Activity1 では、次のスニペットを使用します。
Intent intent = new Intent(this, Activity2.class);
intent.putExtra("SuperSecretValue", /* put your string here */);
startActivity(intent);
Activity2 で、次のスニペットを使用します。
String superSecretValue = getIntent().getStringExtra("SuperSecretValue");
Intent intent = new Intent(this, Activity3.class);
intent.putExtra("SuperSecretValue", superSecretValue);
intent.putExtra("AnotherSuperSecretValue", /* put your string here */);
startActivity(intent);
Activity3 で、次のスニペットを使用します。
String superSecretValue = getIntent().getStringExtra("SuperSecretValue");
String anotherSuperSecretValue = getIntent().getStringExtra("AnotherSuperSecretValue");
インテントでできることの詳細については、ドキュメントを確認してください。この特定のケースでは、追加のキーと値のペア (「エクストラ」と呼ばれる) をインテント オブジェクトに追加して、インテント オブジェクトを使用して開始するアクティビティで名前で取得できます。