0

This is my activity Login Code

public void onClick(View v) {
    switch (v.getId()){
        case  R.id.email_sign_in_button:

            EditText em = (EditText) findViewById(R.id.email);
            EditText pass = (EditText) findViewById(R.id.password);
            String password=pass.getText().toString();
            String email=em.getText().toString();
            String storedPassword =helper.getSinlgeEntry(email,password);
            String storedName =helper.getName(email);
            if(password.equals(storedPassword))
            {
                Intent i1 = new Intent(LoginActivity.this, MainActivity.class);
                i1.putExtra("1", storedName);
                i1.putExtra("2",email);
                startActivity(i1);
                Toast.makeText(LoginActivity.this, "Congrats: Login Successfull", Toast.LENGTH_LONG).show();

            }
            else
            {
                Toast Tpass = Toast.makeText(LoginActivity.this, "Invalide Mot de Passe", Toast.LENGTH_LONG);
                Tpass.show();
            }

            break;
            case  R.id.creer:
            Intent i1 = new Intent(LoginActivity.this, InscriptioNActivity.class);
            startActivity(i1);
            break;
    }
}

The Intent in the Code will be send it to MaintActivity with two value email and name

enter image description here

I want To put there and this is nav header

enter image description here

Like this example

enter image description here I Want where i will put in MainActivty

getIntent().getExtras().getInt("1");

If something Missing in code i will add Thank You So Much ^^

Ayoub Bsl
  • 159
  • 2
  • 6
  • 14

0 Answers0