Why is this not working ?!
if(itemx == \"Test number item 0\")
{
Log.i(\"Dropdown\", \"inside if\");
us_lo_ans_hold.setText(\"0x\");
};
<
Never compare Strings with ==, use equals:
if(itemx.equals("Test item 0")){...
As for onNothingSelected, the documentation states it will be called for example if you delete the selected item from your adapter.
If your itemx
is a variable then you cant compare two strings with ==
. Use instead items.equals("Test number item 0");
==
compares objects and equals()
compare string values.
Take a look a this post.