pass data between activities [closed]

1

Hi, I'm trying to send this data between activities but it does not work for me, can it be?

  entrar.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {

            Intent intent = new Intent(MenuActivity.this, MainActivity.class);
            String usu=usuario.getText().toString();

          //  intent.putExtra("turno", turno.getItemAtPosition(turno.getSelectedItemPosition()).toString());
            intent.putExtra("usuario", usu);



            startActivity(intent);
            finish();

        }

    });

and with this I receive it in the second activity

  String usu = getIntent().getStringExtra("usuario");

android: id="@ + id / users" this is the edittext that I want to send and receives it "@ + id / user" and I have already declared them both

    
asked by juan perez 06.11.2017 в 17:06
source

0 answers