I'm beginner for Android, im having stringArray resource on string.xml file.. i need check whether the item name is correct then i hav to do something.. im entering the correct item name but it goes to else part.. may be the problem is in if(itemname=stringArray).. plz give me the solution ..
String[] drugs = getResources().getStringArray(R.array.Drugsinfo);
if(editext1.getText().equals(drugs))
{
Toast.makeText(getApplicationContext(), "some usefull info for you buddy ...", Toast.LENGTH_SHORT).show();
Intent myIntent = new Intent(MainActivity.this, Descriptionjava.class);
startActivity(myIntent);
}
else
{
Toast.makeText(getApplicationContext(), "Wrong pill name !! check out the list",Toast.LENGTH_LONG).show();
bt1.setEnabled(true);
}
}