I'd like to know how to pass the content of a plainText that is in the MainActivity direct to Main3Activity, without having to also import to Main2Activity and then to Main3Activity.
The user passes Main2Activity before going to Main3Acitvity.
MainActivity has a plainText (etPlanetaVive) where the user informs the planet where he lives.
MainActivity.java
ackage genesysgeneration.third;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
public class MainActivity extends AppCompatActivity implements View.OnClickListener{
private EditText etPlantaVive;
private Button btnNext_01;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
etPlantaVive=(EditText)findViewById(R.id.etPlanetaVive);
btnNext_01=(Button)findViewById(R.id.btnNext_01);
btnNext_01.setOnClickListener(this);
}
public void onClick(View v){
Intent it = new Intent(this, Main2Activity.class);
it.putExtra("planetaVive", etPlantaVive.getText().toString());
startActivity(it);
}
}