Math

Answered

can't destory activity correctly, because eidtor closed

image

How to avoid this situation


Best Answer

Dear Heyb6,


Thank you for contacting us.


Based on your log, I would say that in the onDestroy function, you are trying to close the editor while it has already been closed.


If it shall not be closed, you shall investigate when and why it was closed previously.


Otherwise, you can simply check if the editor has not been closed, as we do in our getStarted:

@Override
protected void onDestroy()
{
...
Editor editor = editorData.getEditor();
if (editor != null)
  {
editor.getRenderer().close();
editor.close();
  }
...
// IInkApplication has the ownership, do not close here
engine = null;

super.onDestroy();
}


Let us know if this helps.


Best regards,


Olivier


Answer

Dear Heyb6,


Thank you for contacting us.


Based on your log, I would say that in the onDestroy function, you are trying to close the editor while it has already been closed.


If it shall not be closed, you shall investigate when and why it was closed previously.


Otherwise, you can simply check if the editor has not been closed, as we do in our getStarted:

@Override
protected void onDestroy()
{
...
Editor editor = editorData.getEditor();
if (editor != null)
  {
editor.getRenderer().close();
editor.close();
  }
...
// IInkApplication has the ownership, do not close here
engine = null;

super.onDestroy();
}


Let us know if this helps.


Best regards,


Olivier

thanks for you reply,i will add this code block and try to solve this situation