I have a String value which is the text from an EditText
and I want to use that String
value in another activity.
In a TextView
the user puts his/her name and in the next activity I want to have a Welcome screen that says, Hello, name
package com.example.aprendelastablasdemultiplicar;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.EditText;
import android.widget.TextView;
public class pantalla2 extends AppCompatActivity {
private EditText ingresarnombre;
private TextView cifracero;
private TextView cifrauno;
ingresarnombre = (EditText)findViewById(R.id.ingresarnombre);
String nombre = ingresarnombre.getText().toString();
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_pantalla2);
cifracero.setText(0);
cifrauno.setText(1);
}
}