Am sending a few variables from main.java:
Bundle bund = new Bundle();
Intent intent = new Intent(this, newWindow.class);
String name = editName.getText().toString();
bund.putString(yourName, name);
String pass= editPassword.getText().toString();
bund.putString(yourPass,pass);
String mail=EditMail.getText().toString();
bund.putString(yourMail,mail);
intent.putExtras(bund);
startActivity(intent);
to newWindow.java:
Intent intent = getIntent();
Bundle extras = intent.getExtras();
String name = extras.getString(main.yourName);
String mail = extras.getString(main.yourMail);
String pass = extras.getString(main.yourPass);
viewText1 = (TextView) findViewById(R.id.textView2);
viewText2 = (TextView) findViewById(R.id.textView3);
viewText3 = (TextView) findViewById(R.id.textView4);
viewText1.setText(name);
viewText2.setText(mail);
viewText3.setText(pass);
The problem is, only last variable is passed and showed in all 3 textview's
Presumably, you are using the same key in all cases. In other words, your value of
yourNameis the same as the value ofyourPass, which is the same as the value ofyourMail. These need to have unique values. Usually, we usestatic final Stringkeys forBundle.