lundi 28 décembre 2015

Sqlite sending user id by username

I need to send specific id to another activity, "i.putExtra" sends the username but is there a way to send that user's id as well?

    public void onButtonClick(View v)
{
    if(v.getId() == R.id.Blogin)
    {
        EditText a = (EditText)findViewById(R.id.TFusername);
        String str = a.getText().toString();
        EditText b = (EditText)findViewById(R.id.TFpassword);
        String pass = b.getText().toString();

        String password = helper.searchPass(str);
        if(pass.equals(password))
        {
            Intent i = new Intent(MainActivity.this, Category.class);
            i.putExtra("Username",str);
            startActivity(i);
        }
        else
        {
            Toast warn = Toast.makeText(MainActivity.this , "Username or password wrong!" , Toast.LENGTH_SHORT);
            warn.show();
        } }

Aucun commentaire:

Enregistrer un commentaire