I'm developping a HWR app for Android using the MyScript ATK2.2. I've been testing it using an Android Studio Virtual Device (Nexus 9 tablet, Android 6.0 (API 23)).
I've been dealing with the CandidateInfo class for a while (as I posted in another thread before). While trying to learn more about this, at one point I executed the CandidateInfo#delete() method. From there on the ATK won't give me any more candidate info. SingleLineWidgetApi#getWordCandidates() returns a CandidateInfo object, but since that fatal delete(), it doesn't contain any useful information any more (i.e. getSize() would always return 0, getSelectedLabel() and getSelectedSource() would both return "", getStart() and getEnd() would both return -1 and so on).
I tried to figure out, what might have been deleted (searching filesystem for files modified within the relevant time), but wasn't able to determine, what it might be. I can only guess, that any link to a resource or part of a resource is missing (since getSelectedSource() returns "", whereas it used to return some String looking like a file name (ending with .lex,if I remember correctly)). But I just don't know, how to put that thing back into place.
Trying some simple repair moves, I've deleted and re-applied all resource files I use. I've also replaced the ATK .aar-files with fresh ones. I've cleared the Android Studio build cache, cleaned and rebuilt the gradle project, uninstalled the Android Virtual Device and created a new one, everything with obviously no effect.
So, I've no idea where else to look for the problem's cause. I'd appreciate any help, e.g. information about what the delete() method actually does... ;)
Thank you very much!
This was the result of placing the cursor behind the last word and then using getCursorIndex() to receive the word candidate. So in fact I didn't really select any word (highest useful value would have been the index of the last character (which in my case is equal to getCursorIndex()-1)) and thus the CandidateInfo was empty.