You can add fourth attribute WriteMode.NonBlocking
in the Write
method.
By the way, when you execute the write method, you can do it inHandlerThread
.
As Note: please don't make a screenshot about your code, you can copy your code here directly.