Convert SpenObjectBase to String for EditText

116 views Asked by At

I am working on Samsung Mobile SDK and using it's TextRecognition feature for recognition of text written on SpenSurfaceView. I have done this using example provided by Samsung. After conversion I receive data as object SpenObjectBase class.
Now my question is can we convert this SpenObjectBase object as String so that I can show the converted text in EditText ?

Thanks in advance.

1

There are 1 answers

3
kiruwka On BEST ANSWER

You could try casting it to SpenObjectText and then extracting CharSequence with getText() method:

SpenObjectBase base = //.. your object containing text data
if (base instanceof SpenObjectText) {
    SpenObjectText text = (SpenObjectText) base;
    mEditText.setText(text.getText());
}