Egepa New Member Sep 29, 2024 #1 Hello everyone, I am experiencing a similar bug to this post https://www.b4x.com/android/forum/t...ect-my-usb-accessory-before-opening-it.30222/, when i try to call InputStream.close() on my apps onDestroy() it does throw "read interrupted" exception fine. However when i re-open my app and try to get info from inputstream i can't get anything even tough outputstream works fine (I can send data). I do close filedescriptor, inputstream, outputstream, and exit the thread doing the reading. What can it be the problem i have been looking for answers online for days but only answers i found was related to do "soft reset". When i unplug and replug the usb cable it works fine again until i exit and enter again to the app. Is there something i am missing, does anyone solved a simillar problem?
Hello everyone, I am experiencing a similar bug to this post https://www.b4x.com/android/forum/t...ect-my-usb-accessory-before-opening-it.30222/, when i try to call InputStream.close() on my apps onDestroy() it does throw "read interrupted" exception fine. However when i re-open my app and try to get info from inputstream i can't get anything even tough outputstream works fine (I can send data). I do close filedescriptor, inputstream, outputstream, and exit the thread doing the reading. What can it be the problem i have been looking for answers online for days but only answers i found was related to do "soft reset". When i unplug and replug the usb cable it works fine again until i exit and enter again to the app. Is there something i am missing, does anyone solved a simillar problem?
Erel B4X founder Staff member Licensed User Longtime User Sep 29, 2024 #2 Not sure what you mean with onDestroy, however when the OS kills the process it doesn't raise any event. Where is the communication code implemented? Don't use an Activity for that. Use B4XPages or a service. Upvote 0
Not sure what you mean with onDestroy, however when the OS kills the process it doesn't raise any event. Where is the communication code implemented? Don't use an Activity for that. Use B4XPages or a service.