In my android application i want to send the value of EditText from an Activity1 to Activity2 to be used there ..What can i do please??
//This is my first Activity
public class registrer extends Activity {
EditText ET_USER_NAME,ET_USER_PASS,ET_USER_CONFIRM;
Button btsuivant;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_registrer);
ET_USER_NAME=(EditText)findViewById(R.id.new_user_name);
Intent intent = new Intent(this,CreerCV3.class);
intent.putExtra("Key1", ET_USER_NAME.getText().toString());
}}
// the CreerCV3
public class CreerCV3 extends Activity {
String user_name,user_pass,user_confirm;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_creer_cv3);
Intent intent=getIntent();
String s=intent.getStringExtra("Key1");
TextView t=(TextView)findViewById(R.id.ob);
t.setText(s);
}}
//xml of the textviex
android:id="@+id/ob" />
//xml of the editText (regiter)
seems like everthing is ok but when i run the app there is no text displayed.....