mercredi 25 avril 2018

Condition only reads 1st else if the rest are not android

The condition only reads the first else if the next else ifs is not reading why? tho I've tried all conditions to if but all of the toast all toast up how do i fix this?

if (option1.getTag().equals(choice1.getTag()) && option2.getTag().equals(choice2.getTag()) && option3.getTag().equals(choice3.getTag()))
    {
        Toast.makeText(FundamentalAct.this,  "Correct" , Toast.LENGTH_LONG).show();
                Intent i = new Intent(FundamentalAct.this, FunAns.class);
                startActivity(i);
    }

    else if  (!option3.getTag().equals(choice2.getTag()) || !option1.getTag().equals(choice2.getTag()))
    {
        Toast.makeText(FundamentalAct.this,  "String[] args is a reserved words cannot be used for other purpose of the program" , Toast.LENGTH_LONG).show();
    }

    else if (!option2.getTag().equals(choice3.getTag()) || !option1.getTag().equals(choice3.getTag()))
    {
        Toast.makeText(FundamentalAct.this,  "System.out.println is used for printing value(s)" , Toast.LENGTH_LONG).show();
    }

   else if (!option3.getTag().equals(choice1.getTag()) || !option2.getTag().equals(choice1.getTag()))
    {
        Toast.makeText(FundamentalAct.this,  "Welcome is a Class" , Toast.LENGTH_LONG).show();
    }

    else
        {
        Toast.makeText(FundamentalAct.this,  "Complete the blank/s" , Toast.LENGTH_LONG).show();
    }

Aucun commentaire:

Enregistrer un commentaire