If I am right and you're comparing android TextView
instance text, you need to call:
boolean match = text.getText().toString() == hits.getJSONObject(i).getString("name");
text.toString() returns the instance hascode not the string inside TextView
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…