iink SDK on Device

Answered

NullPointerException ( Interactive-ink-examples-android 1.5 https://github.com/MyScript/interactive-ink-examples-android)

When I tried the 1.5 version of the Demo, I found that there was a null pointer exception and a crash error:

Process: com.myscript.iink.demo, PID: 14799
java.lang.NullPointerException: Attempt to get length of null array
at com.myscript.iink.uireferenceimplementation.SmartGuideView.computeModificationOfWords(SmartGuideView.java:626)
at com.myscript.iink.uireferenceimplementation.SmartGuideView.update(SmartGuideView.java:531)
at com.myscript.iink.uireferenceimplementation.SmartGuideView.contentChanged(SmartGuideView.java:378)
at com.myscript.iink.Editor$3.accept(Editor.java:156)
at com.myscript.iink.Editor$3.accept(Editor.java:152)
at com.myscript.iink.ListenerList.forEach(ListenerList.java:53)
at com.myscript.iink.Editor.contentChanged(Editor.java:151)


Best Answer

 In addition, in order to avoid a crash in such a situation, you can add a check on oldWords in the SmartGuideView class:

 

 

 

private void computeModificationOfWords(SmartGuideWord[] words, SmartGuideWord[] oldWords)
if (oldWords == null) return;
...

 

 Best regards,


Gwenaëlle

 



Dear Hedy,


Thank you for contacting us.


I have not been able to reproduce your issue with the Demo.

Have you identified a scenario to reproduce the issue? 

Which part and configuration are you using?



Best regards,


Gwenaëlle

Answer

 In addition, in order to avoid a crash in such a situation, you can add a check on oldWords in the SmartGuideView class:

 

 

 

private void computeModificationOfWords(SmartGuideWord[] words, SmartGuideWord[] oldWords)
if (oldWords == null) return;
...

 

 Best regards,


Gwenaëlle

 


  • Support
  • Forums
  • iink SDK on Device
  • NullPointerException ( Interactive-ink-examples-android 1.5 https://github.com/MyScript/interactive-ink-examples-android)