I'm trying to check the string if a sentence has a word "TIN" but it says false when i try to use equal or '=='. Here is my code.
if (!recognizer.isOperational()) {
Toast.makeText(this, "Error", Toast.LENGTH_SHORT).show();
} else {
Frame frame = new Frame.Builder().setBitmap(bitmap).build();
SparseArray<TextBlock> items = recognizer.detect(frame);
StringBuilder sb = new StringBuilder();
//get text from sb until there is no text
for (int it = 0; it < items.size(); it++) {
TextBlock myItem = items.valueAt(it);
sb.append(myItem.getValue());
sb.append("\n");
if (myItem.getValue() == ("TIN")) {
Toast.makeText(this, "VERIFIED ID", Toast.LENGTH_SHORT).show();
} else {
Toast.makeText(this, "WRONG ID", Toast.LENGTH_SHORT).show();
}
}
//set text to edit text
mResultEt.setText(sb.toString());
}