I use a service to open connection to USB Accessory. I use an input stream that is bind to the FileDescriptor I get from UsbManager's openAccessory() method. Everything works fine as long as I don't start a new activity. For some reason when I start a new activity I get IOException (File descriptor closed). Any ideas why this is happening? I wan't it to work so that the input stream stays connected across activities.
You must put your usb connection in a Service (not a bind service but foreground or background) and communicate the data received with a broadcast receiver.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With