this is a piece of a script that has to recognize a text from the camera through TextRecognizer
and then search a certain word inside the text. If the word is present, the system has to save in String found
the word after.
The problem is that I have this two errors:
Cannot resolve method 'contains(java.lang.String)'
Cannot resolve method 'getValue(int)'
How can I solve this errors? I haven't found any similar method for SparseArray<TextBlock>
.
public void receiveDetections(Detector.Detections<TextBlock> detections) {
String search = "palabra";
final SparseArray<TextBlock> items = detections.getDetectedItems(); //is the detection of textRecognizer of the camera
for (int i=0; i<items.size(); ++i)
{
if(items.get(i).contains(search))
{
String found = items.getValue(i+1);
Log.i("current lines ", found);
}
}
}